赞
踩
项目场景:简单的数据库连接
报错:Unknown database ' '
- Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'jdbc'
- at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
- at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
- at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
- at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
1.检查数据库有没有相应的库名
2.检查获取对象是否书写错误
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。