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

Recommended Answers

All 8 Replies

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

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 

DrverManager.getConnection(database_url,"user_name","password");

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

http://www.quickprogrammingtips.com/java/connecting-to-oracle-database-in-java.html

please check it once

let me know the status

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

If oracle Express in stalled the default database name will be XE only.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.