public void InsertPerson()throws Exception{
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/Person","root","mysql");
Statement stmt=conn.createStatement();
stmt.executeUpdate("insert into per values('+userName.getText()'+'+userAge.getText()')");
}
JDBC中增加数据的代码实现不了。
请问哪里错了
|