Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC driver for mysql

 
Rashmi Uttarkar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to establish a connection to mysql thru weblogic 8.1. I have configured mysql and added the mysql jdbc driver to the
classpath. When I try to create a connection pool weblogic gives me the
following error - 'jdbc driver not in classpath'. I have rechecked my
classpath. Everything seems to be in place. Can somebody please help?
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

add the mysql jdbc driver to the weblogic classpath not the OS classpath. To do this edit the startWeblogic script you can do something like this:

if you place the mysql driver under, for example:
%WL_HOME%\server\lib\

then you can create a line on the startWeblogic script as:

set MYSQL_CLASSPATH=%WL_HOME%\server\lib\mysql_jdbc.jar

then edit the classpath line on the script to include the MYSQL_CLASSPATH:
 
Rashmi Uttarkar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcos,

I have tried that too. I have tried all stunts, but it just wont work!!!

Rashmi...
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

that's weird. I have an application running on Weblogic/Mysql and that did work for me.
 
Ner min
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i have the same problem and it simply dont work
in my startWLS.cmd file
i added this line
set MYSQL_CLASSPATH=%WL_HOME%\server\lib\mysql-connector-java-3.1.11-bin.jar
and replaced this line
set CLASSPATH=%MYSQL_CLASSPATH%;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;%CLASSPATH

but according to doc this file istn read att all (at least by default bewWL installation) instead the file %WL_HOME%\samples\domains\workshop\startWebLogic.cmd is read
so i placed thos two lines there too and again nothing happand.
hence in
%WL_HOME%\samples\domains\workshop\startWebLogic.cmd

is one line
echo CLASSPATH=%CLASSPATH%

but when i look at the output of cmd(which starts the beaWL)
there is no C:\mysqlconnectorjava3111\mysql-connector-java-3.1.11-bin.jar entry in the classpath although i set it via rightclick on mycomputer->propertis->advenced->env.vars...

i simply dont know which classpath is takeing and where to set it


im running beaWL 8.1 sp3 on w2k sp3

i was able to make a connection via JDBC in DBVisualiser and there C:\mysqlconnectorjava3111\mysql-connector-java-3.1.11-bin.jar worrked. But there was clear question wher to look for jdbc-driver, so i pointed to C:\mysqlconnectorjava3111\mysql-connector-java-3.1.11-bin.jar and there was no problem.
But which(where) is the classpath for beaWL?

please, can anyone help?
[ October 21, 2005: Message edited by: Ner min ]
 
Davinder Pal Singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also facing the same issue
jdbc driver not in classpath for mysql when trying to create a connecion pool in weblogic
I have put the mysql-connector-java-3.1.11 in C:\bea\weblogic81\server\lib.

and modified the startweblogic.cmd to make it working..

but it does not help

can someone please tell what the issue is??

Thanks,#
Davinder
 
Santosh Maskar
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add driver jar file into the
\\beasp5\weblogic81\samples\domains\workshopset\DomainEnv.cmd

for eg.
set CLASSPATH=%PRE_CLASSPATH%;%WEBLOGIC_CLASSPATH%;%CLASSPATH%;%POST_CLASSPATH%;%WLP_POST_CLASSPATH%;c:\mysql\mysql_jdbc.jar

after adding the jar file into the classpath you can see the Weblogic console whether your newly added jar files is listed into the server classpath
or you can print the classpath using echo %classpath%


This wokrs fine on my box : WIN2K/WLS8.1SP5
 
Chris Wash
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
weblogic actually edits the startWeblogic.sh/.bat script, so it's probably not a good idea to put anything in there. setDomain.env is a good spot to put your check, you can also put your reference in the /bea/user_projects/domains/wls/_cfgwiz_donotdelete/startscript.xml, which gets merged at runtime as well, ie:

 
Md. Atif Rasheed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys i know that the solution to this issue is very late but i feel it may help someone.I have a solution for this problem and its working fine now.

To get the mySQL driver in the classpath of the weblogic server look in the following path for a file commEnv.cmd.

You can find it in d:\\bea\weblogic81\bin\commEnv.cmd

When you open it you will find lot of stuff. Add this at the end of classpath line.

;%WL_HOME%\server\lib\mysql.jar here mysql.jar contains jdbc driver.

and copy the jar file in lib folder of the weblogic server

d:\\bea\weblogic81\server\lib\mysql.jar

and start the weblogic server.It will work fine.

My email id:mdatif07@yahoo.co.in

Byeeee

[ August 23, 2007: Message edited by: decent dude ]
[ August 23, 2007: Message edited by: decent dude ]
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi decent dude,

Your post definitely saved my day! I was trying to add a custom JAAS LoginModule for JMX in WebLogic and was also having classpath issues.

Your solution works very well! Thank you very very much.

Paul
 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Atif,

Your advice is continuing to help others. You receive Kudos royalties

Thanks,

Ken
 
Scott Selikoff
author
Saloon Keeper
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Atif"

Your name still does not conform to the JavaRanch Naming Policy. Please review the policy and update it appropriately. This is your second warning.

Scott
 
Priyesh Beohar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...
I also successfully connected
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This post is 5 years old. But we are glad that it helped you.
 
Indrayani Bhoir
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ..it is really helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic