在JdonFramework中使用JNDI連線Mysql資料庫問題?

yekongda發表於2007-06-22
彭老師,根據您的例項(jboss+mysql)
小弟首先在jboss中mysql-ds.xml下自定義名Mark的JNDI,資料庫名為mark
<local-tx-datasource>
<jndi-name>Mark</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mark?useUnicode=true&characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<message-name>banq</message-name>
<password>225034ba</password>
</local-tx-datasource>
然後在在jdonframework中設定
<pojoService name="constants" class="com.mark.test.Constants">
<constructor value="java:/Mark"/>
</pojoService>
在執行時報錯??
WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: General error, message from server: "Access denied for user: '@localhost' to database 'mark'")
是不是在別的地方還要設定??

相關文章