hi friends,
I am getting "Class Not Found" error while connecting to Oracle Database using
JDBC connection.
I have written the following code....
import java.sql.* ;
import java.io.* ;
class CheckOra
{
public static void main(
String args[])
{
Connection connection;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
// Create a connection to the database
String serverName = "127.0.0.1";
String portNumber = "1521";
String sid = "Homoeo";
String url = "jdbc
racle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "lakshmi";
String password = "lakshmi";
connection = DriverManager.getConnection(url, username, password);
System.out.println("Connected");
} catch (ClassNotFoundException e) {
System.out.println("Class not found");
// Could not find the database driver
} catch (SQLException e) {
System.out.println("Could not connect");
// Could not connect to the database
}
}
}
Please tell me where I am going wrong.....
Thank u...
lakshmi