Hi Guys,
I Installed Oracle 10g in my Local system and now I am having problem connecting to it
from my java code. Below is my Code.
try {
Class.forName("oracle.jdbc.driver.OracleDriver"); // Loads the Driver
Connection connect = DriverManager.getConnection("jbdc:oracle:thin:@//localhost:1521/XE","
System","
1234"); // Establishing Connection
Statement stmnt = connect.createStatement(); // To create a Statement
ResultSet rs = stmnt.executeQuery("insert into a values ( 1 )"); // Execute a query
}
catch(java.lang.ClassNotFoundException e1)
{
System.err.print("ClassNotFoundException: ");
System.err.println(e1.getMessage());
}
catch(java.sql.SQLException e2)
{
System.err.print("Sql exception ");
System.err.println(e2.getMessage());
}
System and
1234 are the User name and Password for my local machine database.I have already created a table named
a and I am trying to insert a value into it's attribute. I am however getting this exception"
Class not found Exception:oracle.jdbc.driver.OracleDriver" Should I specifically look into anything?/ Oracle in my machine is running on port
8081 and I have already included the following import statements:
import java.sql.*;
import java.io.*;
import java.util.*;
import java.util.Enumeration;
Thanks.
[ March 05, 2008: Message edited by: Arjun Reddy ]
[ March 05, 2008: Message edited by: Arjun Reddy ]
[ March 05, 2008: Message edited by: Arjun Reddy ]