Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String Username = jTextFieldUsername.getText();
- String Password = jTextFieldPassword.getText();
- try { Class.forName("com.mysql.jdbc.Driver"); }
- catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: " + e.getMessage()); }
- String passwordDB = "";
- try {
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/ipig", "root", "root");
- Statement stmt;
- stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
- stmt.executeUpdate("Insert into login(username,password)values('"+Username+"','"+Password+"')" );
- stmt.close();
- con.close();
- new register().setVisible(false);
- new iPig2().setVisible(true);
- }
- catch(SQLException ex) { System.err.println("SQLException: " + ex.getMessage()); }
Add Comment
Please, Sign In to add comment