DIGIT-ARC read-only archive · snapshot: July 23, 2026

jdbc connection with oracle

5 posts · originally from https://geek.digit.in/community/threads/jdbc-connection-with-oracle.99741/

V
vijay_ss2004 Original post #1
Oct 13, 2008 at 9:49 PM
hi folks i want to connect java application program with oracle 10g express edition . i tried hell lot of times but it showing classnotfound exception.i dont know which driver to use whether oci or thin driver.i also set classpath for oracle14.jar in environment varibles.i dont know wats the problem. can any of u help me regarding this.pls reply asap.thankx in advance folks.plssssssssssssssssssssssssssssss.....
ruturaj3
Oct 14, 2008 at 11:12 AM
Post ur program. May be some thing wrong with ur coding.
chk this
*www.java-tips.org/other-api-tips/jdbc/how-to-connect-oracle-server-using-jdbc-4.html
V
Oct 16, 2008 at 6:44 AM
yeah this was my code can u find wats thw error is

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager.*;
import java.sql.*;
public class simple
{
public static void main(String args[]) throws SQLException,ClassNotFoundException
{
try
{
//DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:eek:racle:eek:ci:mad:XE","system","vijay");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from sample");
while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getInt(2));
}
con.close();
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
}
}

pls suggest me wat to do ....................thankx in advance ....

after executing the above program i m getting
C:\Program Files\Java\jdk1.5.0\bin>java -classpath . simple
Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.
OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at simple.main(simple.java:15)
pls help folks...................
B
Bandu #4
Oct 16, 2008 at 3:05 PM
Why are you specifying the classpath when compiling the source?

Make it as your environment variable and make sure that your classes12.zip (or whatever) is in your classpath.
furious_gamer
Oct 16, 2008 at 3:41 PM
ClassNotFoundException insense means that the compiler was unable to find the Oracle Driver file....Make sure u copy that file and paste it in ur classpath...