tnsname with thin driver
626761Mar 5 2008 — edited Mar 10 2008i want to use the thin driver with a tnsname but the following raises
java.sql.SQLException: E/A-Exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
private Connection con;
public void openConnection( String tnsname, String username, String password ) throws ClassNotFoundException, SQLException {
Class.forName("oracle.jdbc.driver.OracleDriver"); // Driver registration
OracleDataSource ods = new OracleDataSource();
String connectionstring = "jdbc:oracle:thin:@"+tnsname;
Properties info=new Properties();
info.put( "tnsEntry", tnsname );
info.put( "user", username );
info.put( "password", password );
con=DriverManager.getConnection( connectionstring, info );
con.setAutoCommit( false );
}
if i use instead:
String connectionstring = "jdbc:oracle:oci:@"+tnsname;
the connection is established. Thats proofs that my tnsnames.ora is valid. - But when i call con.commit on the oci driver i am getting the following error (thats why i want to use the thin driver):
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x61d32910, pid=9092, tid=8052
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_14-b03 mixed mode, sharing)
# Problematic frame:
# C [OraClient10.Dll+0x112910]
#
# An error report file with more information is saved as hs_err_pid9092.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
I am using java 1.5 under windows xp an the destination oracle database is either a 9i or 10g. I tried ojdbc14.jar, classes 12.jar, ojdbc5.jar - all with the same errors