what is the driver and url for oracle 11g
and kindly suggest me suitable jdbc jar file for oracle 11g

4 Years
Discussion Span
Last Post by radhakrishna.p

ojdbc6.jar or ojdbc5.jar files needed to connect oracle 11g databse

what is the driver and url for oracle 11g

what does URl means in this context? (i mean you are asking connection url to this database to connect with your application)

let me know clearly once

Edited by radhakrishna.p: getting information about problem


yes you are correct
URL and driver are used to connect with oracle form java through coding


i think the following will be the connection string for connecting oracle 11g in java

String database_url ="jdbc:oracle:thin:@<host_name>:1521:<service_name>";

for example : (in coding) 

String database_url = "jdbc:oracle:thin:@localhost:1521:XE";

// getting conection object here 


the following url expalins all the details of connecting to oracle 11g database along with driver details :


please check it once

let me know the status

Edited by radhakrishna.p: giving clarity on the solution


hi as per your instructions i have followed.
this is the error i am getting

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor


the error is about whatever you provided name 'XE' in the database_url is incorrect to say directly

so i think you need to change the value of 'service_name_or_SID_here' in the given bellow connection URL

String database_url ="jdbc:oracle:thin:@<host_name>:1521:<service_name_or_SID_here>";

you have given XE for that, but you need to check once what is the sid of your database?

execute the following command at sql_prompt of your oracle 11g database inorder to get the SID of the database

SELECT * FROM global_name;

it gives the sid of your database replace with that name in the above database_url as follows

String database_url ="jdbc:oracle:thin:@<host_name>:1521:NEW_SID_NAME_HERE";

and then check it once and remaining things are as it is

let me know the status


the default sid name for oracle 11g is orcl
i have tried
and also your instructions
the problems remains

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.