• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

JDBC driver for mysql

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

that's weird. I have an application running on Weblogic/Mysql and that did work for me.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Atif,

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

Thanks,

Ken
 
author
Posts: 4342
40
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks...
I also successfully connected
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This post is 5 years old. But we are glad that it helped you.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ..it is really helpful
 
The only cure for that is hours of television radiation. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic