I have Tomcat 3.2.x running on Windows NT 4.0. My database is mSQL with the msql-jdbc driver from imaginary.com. My problem is that i cannot access the msql database from a servlet running in tomcat. The database works perfectly with a java program running out of the same folder as the servlet class. The HTTP servlets themselves work fine when accessed by a browser(http://localhost:8080/myserv/servlet/mytest). This means that the VM can access the database and the servlet environment is fine but servlets and database don't like each other. I use the following piece of code to access the database in the servlet and the normal java program. // connect to mSQL database pim Class.forName("com.imaginary.sql.msql.MsqlDriver"); String url = "jdbc:msql://localhost:1114/pim"; Connection con = DriverManager.getConnection (url, "USERNAME", ""); // execute the query Statement stmt = con.createStatement (); ResultSet res = stmt.executeQuery ( "SELECT first_name, last_name, title, e_mail FROM addr_book "); One surprising thing I see is that the database returns the string "com.imaginary.sql.msql.MsqlDriver" upon running the servlet. How can this be? I believe i haven't configured Tomcat properly resulting in Tomcat not being able to see/conect to the database. Can someone guide me on this please? Any help will be greatly appreciated. Thanks, --Kanwar __________________________________________________ FREE voicemail, email, and fax...all in one place. Sign Up Now! http://www.onebox.com
