Executing a Query (Subdomains web hosting) with No Results 93 rs.close();

Executing a Query with No Results 93 rs.close(); } catch(SQLException e) { displaySQLErrors(e); } accountNumberList.setListData(v); } private void buildGUI() { Container c = getContentPane(); c.setLayout(new FlowLayout()); accountNumberList = new JList(); loadAccounts(); accountNumberList.setVisibleRowCount(2); JScrollPane accountNumberListScrollPane = new JScrollPane(accountNumberList); //Do Get Account Button getAccountButton = new JButton(”Get Account”); getAccountButton.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery( “SELECT * FROM acc_acc WHERE acc_id = ” + accountNumberList.getSelectedValue()); if (rs.next()) { accountIDText.setText(rs.getString(”acc_id”)); usernameText.setText(rs.getString(”username”)); passwordText.setText(rs.getString(”password”)); tsText.setText(rs.getString(”ts”)); activeTSText.setText(rs.getString(”act_ts”)); } } catch(SQLException selectException) { displaySQLErrors(selectException); } } } ); //Do Insert Account Button insertAccountButton = new JButton(”Insert Account”); insertAccountButton.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { Statement statement = connection.createStatement(); Listing 5.3 Our application for inserting a new row. (continues)

Note: If you are looking for good and affordable webspace to host and run your servlet application check Sandzak servlet hosting services

Comments are closed.