hello i have some problem in connecting to the oracle server.
do i have to set any dsn in the 32odbc for type4 driver ir. thin driver. i guess no but please help me out.
is there anything to do with the
string after the port number ie "ORCL" in getconnection. how to find out what my oracleserver uses here.
DriverManager.getconnection("....@thin:abc.edu:1521:ORCL","uid",pwd");
please help me
import java.sql.*;
import java.io.*;
/*
i have set the classpath and also set classpath to classes12.zip
*/
public class Mysql {
Connection con;
Statement st;
ResultSet rs;
String uid="scott";
String pwd="tiger";
public Mysql()
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc

racle:thin:@spd.louisville.edu:1521:ORCL",uid,pwd);
System.out.println("connection established \n");
}catch(Exception e){System.out.println(e +"\n \n"); e.printStackTrace();}
}
public static void main (String args[])
{
Mysql ms=new Mysql();
System.out.println("\n IN MAIN after constructor invoked");
} //main
}//class
/* OutPut Errors
C:\CHAK\rayudu>javac Mysql.java
C:\CHAK\rayudu>
java Mysql
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Mysql.<init>(Mysql.java:14)
at Mysql.main(Mysql.java:20)
*/