现在我得到一个运行时错误。'java.lang.UnsupportedOperationException:尚未实现'我该如何恢复它。
private void btnlogActionPerformed(java.awt.event.ActionEvent evt) {
user=txtuser.getText();
char[] pass=jPasswordField1.getPassword();
String passString=new String(pass);
try{
Connection con = createConnection();
String sql = "INSERT INTO login(username,Password) VALUES ('" + user + "','" + passString + "')";
Statement st = con.prepareStatement(sql);
st.executeUpdate(sql);
}
catch(Exception e){
JOptionPane.showMessageDialog(null,"Exception: "+ e.toString());
}
}
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://localhost/Stock?"+
"user=root&password=";
Connection con = DriverManager.getConnection(connectionUrl);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"SQL Exception: "+ e.toString());
} catch (ClassNotFoundException cE) {
JOptionPane.showMessageDialog(null,"Class Not Found Exception: "+ cE.toString());
}
}