Cannot open connection; uncategorized SQLException for SQL [???]; SQL state

Posted dafengchui

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot open connection; uncategorized SQLException for SQL [???]; SQL state相关的知识,希望对你有一定的参考价值。

Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot load JDBC driver class ‘com.mysql.jdbc.Driver‘; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class ‘com.mysql.jdbc.Driver‘

 

这是因为ssh框架或ssm框架的spring托管驱动没写

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://localhost;databaseName=xsxkWzb"></property>
<property name="username" value="sa"></property>
<property name="password" value="123456"></property>
</bean>

以上是关于Cannot open connection; uncategorized SQLException for SQL [???]; SQL state的主要内容,如果未能解决你的问题,请参考以下文章

ssh框架向数据库添加数据时,报错Cannot open connection

org.hibernate.exception.GenericJDBCException: Cannot open connection

cannot open git-upload-pack,cannot open git-receive-pack,Can't connect to any URI错误解决方法eclipse(示

Error in file(file, “rt“) : cannot open the connection In addition: Warning message:In file(file, “

Error in file(file, “rt“) : cannot open the connection In addition: Warning message:In file(file, “

“Unicode Error ”unicodeescape" codec can't decode bytes… Cannot open text files in Python 3