This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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.

Consider Paul's rocket mass heater.
subject: thin driver connection problem @thin:
Similar Threads
Oracle JDBC unable to get connection
JDBC Error
Connect to Oracle via JDBC using JSP..
Reconnecting to an oracle DB
Oracle 8i thin Driver problem