Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases and the fly likes thin driver connection problem @thin: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "thin driver connection problem @thin:" Watch "thin driver connection problem @thin:" New topic

thin driver connection problem @thin:

Rayudu addagarla
Ranch Hand

Joined: Aug 17, 2000
Posts: 39
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.
please help me
import java.sql.*;
i have set the classpath and also set classpath to
public class Mysql {
Connection con;
Statement st;
ResultSet rs;
String uid="scott";
String pwd="tiger";
public Mysql()
try {
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
/* OutPut Errors
C:\CHAK\rayudu>java Mysql
java.sql.SQLException: Io exception: The Network Adapter could not establish the
java.sql.SQLException: Io exception: The Network Adapter could not establish the
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.driver.OracleConnection.<init>(
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at Mysql.<init>(
at Mysql.main(

Good luck for Certfication.
naga bush

Joined: Jan 29, 2001
Posts: 7
The jdbc url for thin drivers is.
Connection con= DriverManager.getConnection(
"jdbc racle:thin:@dbhostname ort:sid","username","password").
SID stands for System Identifier. which identifies the specific oracle database instance to which you want to connect.
Are u using correct dbhostname,port,SID.username and password are according to software instalation.
I hope u r using oracle 8i .Along with this software u will get thin drivers.
To find the hostname and sid in oracle8.
go to
start -->programs -->oracle for winnt -->oracle net8 easy config
click that one. In Next screen give Yes.The next screen is
welcome to service name wizard.In that (Choose actions) select modify radio button and in (existing services) choose available servers(any one). Next screen is Select Networking Protocol
In that one choose tcp/ip. next screen is u will find out the dbhostname and port number. Note down the dbhostname and port and next screen is sid(system identifier).note down the sid.
In oracle8i
start-->programs-->oracle_default_home1 -->network administration
-->net8 assistant-->net 8 confifuration.
In this u will get local.Click the local,the service naming will appear. Click it u will get all the available service names.
Click any one , then u will get the service name, dbhostname,port.
If u have problem please ask your database administrator about the dbhostname,port,sid.
If u r working on oracle 8i the thin driver will be coming along with the software.i don't know about the oracle8.
The classpath what u have specified is o.k.,
All the best.
Inform if u got any problem regarding this.

I agree. Here's the link:
subject: thin driver connection problem @thin:
It's not a secret anymore!