Hey!! i have ORACLE EXPRESS EDITION 10G (10.2)
i want to connect to it using JDBC.
can you tell me what and from where should i download the necessary jdbc driver..do give me the link.
and also how should i connect to it.i mean what code to write,and also how to specify the path of data source name .and changes to be made to the path and classpath.
You can find those easily. A search term that suggests itself would be "oracle express 10g jdbc driver". The results you get for that will also point you to documentation. Since you already have JDBC code, you only need to change the driver class name and the connection URL.
The PATH is not used for Java classes, so nothing changes about that. The driver comes as a jar file, so you will need to add that to the classpath.
ohk thanks i got it,but confused which one to download.oracle website is showing several different drivers for different platforms:
classes12.jar (1,621,582 bytes) - for use with JDK 1.2 and JDK 1.3
classes12_g.jar (2,070,298 bytes) - same as classes12.jar, except that classes were compiled with "javac -g" and contain some tracing information.
classes12dms.jar (1,629,454 bytes) - same as classes12.jar, except that it contains additional code`to support Oracle Dynamic Monitoring Service.
classes12dms_g.jar (2,078,718 bytes) - same as classes12dms.jar except that classes were compiled with "javac -g" and contain some tracing information.
ojdbc14.jar (1,569,316 bytes) - classes for use with JDK 1.4 and 1.5
ojdbc14_g.jar (1,965,422 bytes) - same as ojdbc14.jar, except that classes were compiled with "javac -g" and contain some tracing information.
ojdbc14dms.jar (1,576,882 bytes) - same as ojdbc14.jar, except that it contains additional code`to support Oracle Dynamic Monitoring Service.
ojdbc14dms_g.jar (1,973,634 bytes) - same as ojdbc14dms.jar, except that classes were compiled with "javac -g" and contain some tracing information.
demo.tar (604,160 bytes) - contains sample JDBC programs.
I'm using JDK 1.7 and windows XP 32 bit
i downloaded the driver so what do i need to do..
1) include the jar file in my classpath.but i have already includede the javaFX jar file
So should i remove that one or simply add the ojdbc14.rar after it..
And what changes to be made in Connection URL and driver class name.
right now i'm not using javaFX app .so ok i'll remove that jar file and add ojdbc14.jar.
what about driver name and Connection url.you said i'v to make changes in these cases.So what should i write ?
I guess the following lines need to be modified:
So tell me what should i change
I'v created the table in Oracle express Edition 10g ,logged in.
i'm getting java.sql.SQLException:the network adapter could not establish connection.
I'm not sure about that line in url "@myhost : 1521 : orcl" , i just copied it from oracle site.
I even tried :
Connection con = DriverManager.getConnection ("jdbc : oracle : thin : hr/hr@localhost : 1521 : orcl");
Connection con = DriverManager.getConnection ("jdbc : oracle : thin : hr/hr@localhost : 1521 : XE");
But it's saying "Listener does not currently know of SID given in connect descriptor"
Making random changes when you don't understand what you're changing is not a good way to solve a problem. I suggest you find the driver's documentation on Oracle's site and read the details on how to make a connection. On Google, you can restrict search results to a particular site by adding "site:oracle.com" to your search phrase.
Not sure what you have read since my previous post (given the short time span that passed, probably not much). Start with http://www.orafaq.com/wiki/JDBC. Make sure service name or SID (whichever you use) are correct.
Looked up everywhere.but couldn't figure out what to do
still getting that TNs listener error.
looked into my listener.ora there sid_name=PLSExtProc
so i even tried this
Connection con=DriverManager.getConnection("jdbc : oracle : thin : @localhost : 1521 : PLSExtProc", "hr", "hr");
Now getting the error :"listenere failed to start a dedicated server process"
Looking at your posts, it seems like you have very little idea of how JDBC or SQL works, so maybe you should take an hour or two to work through a few of the simple examples on the JDBC Tutorial? These should help to give you a better foundation for understanding what you're actually trying to do.