Welcome to WebSphere-World!

     Main Menu
· Home
· Topics
· Downloads
· Forums
· Submit News
· Top 10

     Other Modules
· Sign In / Your Account
· Members List
· Statistics
· Feedback
· Need a break? [Games]
· About this site / FAQs

     Who's Online
There are currently, 83 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

     User's Login
Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

     GameHighScores

WebSphere-World: Forums

WebSphere-World :: View topic - MySQL
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log inLog in 

MySQL

 
Post new topic   Reply to topic    WebSphere-World Forum Index -> AppServer General Discussion
View previous topic :: View next topic  
Author Message
GiorgioG



Joined: Jul 23, 2002
Posts: 0
Location: Buffalo, NY, 14216

PostPosted: Wed Jul 31, 2002 12:34 pm    Post subject: Reply with quote

I\'m trying to use MySQL as a database backend while I teach myself the ins & outs of Websphere. At the moment I\'m deploying to Tomcat 4.0. Using the JDBC MySQL driver available from MySQL\'s web site I get a ClassNotFoundException error on this line of code:

Class.forName(\"org.gjt.mm.mysql.Driver\").newInstance();

in a java source file.

What\'s really weird is that the exact same code works in a .jsp page.

I\'ve added the .jar (and also tried unjar\'ing it) in all the lib folders, (tomcat\'s common/lib), websphere\'s own jre/lib & jdk/lib folder, etc. I\'m still getting the same problem and I have no idea why.

Code Snippet:

Class.forName(\"org.gjt.mm.mysql.Driver\").newInstance();
java.sql.Connection conn;
conn=java.sql.DriverManager.getConnection(\"jdbc:mysql://localhost/ContentHive?user=root&password=\");
java.sql.Statement Stmt = conn.createStatement();
java.sql.ResultSet RS = Stmt.executeQuery(\"SELECT * from menus\");

Does anyone have any idea why this is happening?
Back to top
View user's profile Send private message Visit poster's website AIM Address
billylo
Newbie
Newbie


Joined: Jul 14, 2001
Posts: 49

PostPosted: Wed Jul 31, 2002 1:20 pm    Post subject: Reply with quote

The short answer is to put your MySQL driver in your WAR file (under WEB-INF/lib).

The long answer: there are a few different ways to achieve this. WebSphere or other J2EE servers uses their own classloaders to achieve dynamic reload (updating code while the server is still up). For a WebSphere ClassLoader 101 discussion, see this article on WSDD.

http://www7b.boulder.ibm.com/wsdd/library/techarticles/0112_deboer/deboer.html
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    WebSphere-World Forum Index -> AppServer General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2003 phpBB Group
phpBB port v2.0.7 based on Tom Nitzschner's phpbb2.0.6 upgraded to phpBB 2.0.7 standalone was developed and tested by:
ChatServ, mikem,
and Paul Laudanski (aka Zhen-Xjell).

Version 2.0.7 by Nuke Cops © 2004 http://www.nukecops.com




WebSphere is a registered trademark of International Business Machines Corporation in the United States or other countries or both.
Please note that this site is a user-driven community site. It is not operated by IBM. Information is provided on an as-is basis and it may or may not be supported by IBM.

PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.29 Seconds