aspose file tools*
The moose likes JDBC and the fly likes database access problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "database access problem" Watch "database access problem" New topic
Author

database access problem

sneha nimmala
Greenhorn

Joined: Jun 12, 2008
Posts: 1
my programe like this:-
i was setting classpath:-

C:\Java\jdk1.5.0_07\lib;C:\Tomcat 5.0\common\lib\servlet-api.jar;C:\Tomcat 5.0\common\lib\jsp-api.jar;C:\Tomcat 5.0\common\lib\struts.jar;C:\bea\weblogic81\common\lib;G:\oracle\ora92\jdbc\lib\nls_charset12.zip;G:\oracle\ora92\jdbc\lib\ojdbc14.jar;C:\Java\jre1.5.0_07\lib;.



import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
* @author Administrator
*
*/
public class Test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(
"jdbcracle:thin:@localhost:1521raglob", "scott", "tiger");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select id,name from emp");
while (rs.next()) {
System.out.println("result");
System.out.println("id:" + rs.getString(1));
System.out.println("Name:" + rs.getString(2));
}
} catch (Exception e) {
System.out.println("e=" + e);
}
}

}

I AM GETTING eXCEPTION:-
e=java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver


PLEASE SEND SOLUTION FOR ABOVE EXCEPTION
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257


Check your classpath for the above jars. Do you really have a G: drive?


Amit Tank
Linked In
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: database access problem