Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mySQL via EJB in reference implementation

 
paul wheaton
Trailboss
Pie
Posts: 21473
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been tinkering with this for a couple of hours now.
I can see how you can make your EJB's access cloudscape, but I would like to access mySQL.
Can it be done? If so, how?
 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have worked with weblogic which can be connected to 4 types of dbs, and mySql is not one of them. The required driver is not present.
I do not know about other App Servers.
 
paul wheaton
Trailboss
Pie
Posts: 21473
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've worked with weblogic too.
I get mySQL to work okay from applications. I work a jar file into my classpath and do the forName thing.
It seems the reference implementation from Sun uses your classpath (sometimes). But I suspect that somewhre I need to tell it how to do the Class.forName stuff.
 
paul wheaton
Trailboss
Pie
Posts: 21473
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've moved a little further forward.
I've included the following in the config/default.properties file:
jdbc.drivers=COM.cloudscape.core.RmiJdbcDriver rg.gjt.mm.mysql.Driver
jdbc.datasources=jdbc/Cloudscape|jdbc:cloudscape:rmi:CloudscapeDB;create=true|jdbc/DataSource|jdbc:mysql://localhost/soup
(soup is the name of my database in mySQL)
All the JNDI stuff in the deploytool is set to jdbc/DataSource
Here is where my problem is (with debug lines):

And here is what I see on the j2ee console:
xxx 2.1
xxx 2.2
xxx 2.3
xxx 2.4
xxx 2.5
Cannot find principal mapping information for data source with JNDI name jdbc/DataSource
xxx 2.6
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic