This content has been marked as final.
Show 2 replies
-
1. Re: MySQL question/JBoss3 question...
lucvu Aug 14, 2002 5:47 PM (in response to decob)That's the idea. You can also add username and password in the mysql-service.xml itself.
-
2. Re: MySQL question/JBoss3 question...
davidjencks Aug 15, 2002 9:21 AM (in response to decob)Whether you use the login-conf.xml setup or specify the user/pw in your mysql-service.xml file, you should be getting a connection like this:
DataSource ds = (DataSource) new InitialContext().lookup("java:/mysqljndiname");
Connection con = ds.getConnection();
try {
(do work)
}
finally {
con.close();
}
where mysqljndiname is the jndi name you specified in mysql-service.xml
Be sure you have the correct version mysql-service.xml file for your jboss version. There have been many small incompatible changes. One that came with a binary download should be ok for that version.