make sure that the class that you are using for the forName([class name])
method is in your classpath.
(not so much a JSP question by the way, but hope this helps)
Joseph Karau
Kingland Systems
[EMAIL PROTECTED]
507-536-3629
AIM: jkara3629
-----Original Message-----
From: Sharon Om [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 3:23 PM
To: [EMAIL PROTECTED]
Subject: JDBC connection
Hello. I have the following code for connecting to the jdbc:odbc pool.
While compiling the Java code, I keep getting an "ClassNotFoundException" in
Class.forName.
I also tried declaring Class T and have T.forName. I get the similar error
for "T.forName". How can I get this to work?
Thank you for your help.
Sharon
====================
package property;
import java.sql.*;
import java.io.Serializable;
public class database implements java.io.Serializable
{
public database() {
}
public String runSql()
{
String browserOutput = "";
Connection sqlca = null;
Statement sqlStatement = null;
ResultSet myResultSet=null;
/*Connect to database, run SQL and produce output */
try {
/* Connection to the database */
Class.forName("sun.jdbc.odbc.JdbcOdbcDrive");
String theDatabase = "jdbc:odbc:loadtool";
sqlca =
DriverManager.getConnection(theDatabase,"loadtool","loadtool");
}
catch (SQLException e) {
browserOutput = "Error:SQL error of: "+e.getMessage();
}
return browserOutput;
}
}
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets