0
<bean
id="DBDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
lazy-init="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc\:mysql\://pc123456\:3306/reven"/>
<property name="username" value="reven"/>
<property name="password" value="23454"/>
</bean>
這是我的代碼,但日食連接一些其它的數據庫,並給予以下錯誤連接到數據庫,這是從我的不同,春季XML指定
java.lang.AssertionError: Failed due to Error:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [28000]; error code [1045]; Access denied for user 'ules'@'PC234333' (using password: YES); nested exception is java.sql.SQLException: Access denied for user 'ules'@'PC234333' (using password: YES)
請登錄,檢查是否有「數據源」名稱豆,或確保實體管理器(如果使用一個)使用適當的給定用戶名數據源bean。 – nndru
@ndru在數據源名稱和實體管理器中沒有問題 – Gnesh23