Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect J2EE to MySQL?

Status
Not open for further replies.

hgui

Programmer
May 15, 2002
2
AU
I want to use MySQL with J2EE, I'v already put mm.my-2.0.12-bin.jar file and org folder to %J2EE_HOME%\lib\system , i also set CLASSPATH to the directory. What else should i do?
 
Just to the directory or to the .jar file (as if it were a directory) ???
 
Hello, should u not set CLASSPATH to the directory and the mysql jar filename as one complete string? hope this helps, 0-fer.
 
Try extracting the contents of the jar file. Amongst these you should find a jar file called "mysql_uncomp.jar". Try adding this to your classpath. I remember having a similar problem.
 
First step:

In $J2EE_HOME/bin/userconfig.sh,
uncomment

#CLASSPATH=
#export CLASSPATH

and change into

CLASSPATH=$CLASSPATH:/pathtoyourmysqljar/mm.mysqljar-2.0.14-bin.jar
export CLASSPATH

then,
Second step:
On command line, type something similar(as you prefer)
>j2eeadmin -addJdbcDriver jdbc/Mysql org.gjt.mm.mysql.Driver
>j2eeadmin -addDataSource jdbc/Mysql org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource

Hope it help you,
Bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top