没治杰先生 没治杰先生
关注数: 5 粉丝数: 105 发帖数: 245 关注贴吧数: 26
求大神解决这个问题 我在做mysql和severlet的连接这边出问题了,我是想在student表中插入一条新的记录,结果就这样了 exception javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'student'example.Create.doGet(Create.java:47)javax.servlet.http.HttpServlet.service(HttpServlet.java:621)javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'student'sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)java.lang.reflect.Constructor.newInstance(Constructor.java:526)com.mysql.jdbc.Util.handleNewInstance(Util.java:404)com.mysql.jdbc.Util.getInstance(Util.java:387)com.mysql.jdbc.SQLError.createSQLException(SQLError.java:941)com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2546)com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1541)com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2605)com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1469)example.Create.doGet(Create.java:37)javax.servlet.http.HttpServlet.service(HttpServlet.java:621)javax.servlet.http.HttpServlet.service(HttpServlet.java:722) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.
1 下一页