[jboss-user] [Datasource Configuration] - Connection problem to mySQL database

Peter Johnson do-not-reply at jboss.com
Thu Mar 25 11:18:59 EDT 2010


Peter Johnson [http://community.jboss.org/people/peterj] replied to the discussion

"Connection problem to mySQL database"

To view the discussion, visit: http://community.jboss.org/message/534001#534001

--------------------------------------------------------------
You should be acccessing a database connection via the connection pool manager. Do this instead:

InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:MySQLDB");  // Name used in *-ds.xml file
Connection conn = ds.getConnection();

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/534001#534001]

Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100325/9243b918/attachment.html 


More information about the jboss-user mailing list