Using JDBC with Java (Cheapest web hosting) Applications and Applets 94
Using JDBC with Java Applications and Applets 94 int i = statement.executeUpdate(”INSERT INTO acc_acc VALUES(” + accountIDText.getText() + “, ” + “‘” + usernameText.getText() + “‘, ” + “‘” + passwordText.getText() + “‘, ” + “0″ + “, ” + “now())”); errorText.append(”Inserted ” + i + ” rows successfully”); accountNumberList.removeAll(); loadAccounts(); } catch(SQLException insertException) { displaySQLErrors(insertException); } } } ); JPanel first = new JPanel(new GridLayout(3,1)); first.add(accountNumberListScrollPane); first.add(getAccountButton); first.add(insertAccountButton); accountIDText = new JTextField(15); usernameText = new JTextField(15); passwordText = new JTextField(15); tsText = new JTextField(15); activeTSText = new JTextField(15); errorText = new JTextArea(5, 15); errorText.setEditable(false); JPanel second = new JPanel(); second.setLayout(new GridLayout(6,1)); second.add(accountIDText); second.add(usernameText); second.add(passwordText); second.add(tsText); second.add(activeTSText); JPanel third = new JPanel(); third.add(new JScrollPane(errorText)); c.add(first); c.add(second); c.add(third); setSize(500,500); show(); } Listing 5.3 Our application for inserting a new row. (continues)
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services