Question

I am trying to connect oracle9i using jdbc (ojdbc5.jar and ojdbc6.jar). But jdbc connection string is not appending as sysdba at the end of connection string.

But when i do same thing using oracle10/11, It works fine.

This is connection string for 9i

jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.168.1.123)(PORT = 1521)))(CONNECT_DATA = (SRVR=DEDICATED) (SID = abcd)))

Please help me to solve the issue.

Thanks, Anjali

Was it helpful?

Solution 2

Issue is with ojdbc jar.....Please put the ojdbc5.jar in classpath and try.

OTHER TIPS

you can try this:

Properties props;
Connection connection;

props = new Properties();
props.put("user", xxxx);
props.put("password", "yyyy");
props.put("internal_logon", "sysdba");
props.put("v$session.osuser", System.getProperty("user.name").toString());

//if you are using service
connection = DriverManager.getConnection("jdbc:oracle:thin:@your_host:your_port/your_service, props);
//or if you are using sid
connection = DriverManager.getConnection("jdbc:oracle:thin:@your_host:your_port:your_service, props);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top