Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 't1;' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2312) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2122) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at sql.dbutil.main(dbutil.java:24)
4 回答
已采納

慕粉3291149
TA貢獻(xiàn)71條經(jīng)驗(yàn) 獲得超52個(gè)贊
從錯(cuò)誤中可以看出 ? ? ? ? ? ? ? 你數(shù)據(jù)庫(kù)中并沒(méi)有名字為t1的數(shù)據(jù)庫(kù),你仔細(xì)看看

古杰
TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超0個(gè)贊
數(shù)據(jù)創(chuàng)建了,那是不是你在啟動(dòng)sql之后的選擇用戶有沒(méi)有問(wèn)題,用戶沒(méi)有問(wèn)題再看看你了解數(shù)據(jù)庫(kù)的類里面有關(guān)連接數(shù)據(jù)庫(kù)的語(yǔ)法有沒(méi)有問(wèn)題。

qq_連環(huán)_04358155
TA貢獻(xiàn)34條經(jīng)驗(yàn) 獲得超5個(gè)贊
請(qǐng)問(wèn)你要連接的數(shù)據(jù)庫(kù)創(chuàng)建了嗎
添加回答
舉報(bào)
0/150
提交
取消