| | |
help with JDBC oracle9i
![]() |
•
•
Join Date: May 2005
Posts: 82
Reputation:
Solved Threads: 1
hi everyone.
i am an amateur programmer in java.
can anyone please tell me how do i go about connecting my java application to oracle 9i database?
please be specific about what is the URL that i should use and how should i install the oracle JDBC driver.where should i install it.
if it is already available with either JDK 1.5(which i am using) or oracle 9i. where can i locate it and how should i install it. please let me know all the details. thank you.
i am an amateur programmer in java.
can anyone please tell me how do i go about connecting my java application to oracle 9i database?
please be specific about what is the URL that i should use and how should i install the oracle JDBC driver.where should i install it.
if it is already available with either JDK 1.5(which i am using) or oracle 9i. where can i locate it and how should i install it. please let me know all the details. thank you.
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
Here are the drivers of Oracle for java.
http://www.oracle.com/technology/sof...dbc/index.html
Install the jar into the "\jre\lib\ext\" directory of wherever your jsdk is installed at.
This code would print out the database names on the server:
http://www.oracle.com/technology/sof...dbc/index.html
Install the jar into the "\jre\lib\ext\" directory of wherever your jsdk is installed at.
This code would print out the database names on the server:
Java Syntax (Toggle Plain Text)
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url = "jdbc:mysql://192.168.2.184/"; String user = "guest"; String password = "guestPass"; connection = DriverManager.getConnection(url, user, password); DatabaseMetaData dbmd = connection.getMetaData(); ResultSet result = dbmd.getCatalogs(); databases.removeAllElements(); while(result.next()) { System.out.println(result.getString(1)); }
•
•
Join Date: May 2005
Posts: 82
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by Phaelax
Here are the drivers of Oracle for java.
http://www.oracle.com/technology/sof...dbc/index.html
Install the jar into the "\jre\lib\ext\" directory of wherever your jsdk is installed at.
This code would print out the database names on the server:
Java Syntax (Toggle Plain Text)
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url = "jdbc:mysql://192.168.2.184/"; String user = "guest"; String password = "guestPass"; connection = DriverManager.getConnection(url, user, password); DatabaseMetaData dbmd = connection.getMetaData(); ResultSet result = dbmd.getCatalogs(); databases.removeAllElements(); while(result.next()) { System.out.println(result.getString(1)); }
thank you very much sir.i did what u have told me to.
even then i am getting an error saying
"the network adapter could not establish a connection"
"no default driver specified"
"wrong data source name"
what could be the problem?
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
Well you'll need to make changes to the code for it to work for you. Such as the username and password and the server address. You may even have to change the driver name.
I believe Server Crash was referring to the java api documentation.
http://java.sun.com/j2se/1.4.2/docs/...erManager.html
I believe Server Crash was referring to the java api documentation.
http://java.sun.com/j2se/1.4.2/docs/...erManager.html
and put in the correct jdbc URI.
The example used a mySQL database as an example, and of course a different database name and machine.
See the documentation (which you should have, it's available from Oracle and I think comes with the driver) for the details.
The example used a mySQL database as an example, and of course a different database name and machine.
See the documentation (which you should have, it's available from Oracle and I think comes with the driver) for the details.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- jdbc help? (Java)
- JDBC connection (Java)
Other Threads in the Java Forum
- Previous Thread: return data type
- Next Thread: interfaces in java
| Thread Tools | Search this Thread |
911 actionlistener addball addressbook android api append applet application array arrays automation binary bluetooth button character chat class client code component consumer css csv database desktop eclipse ee error fractal ftp game givemetehcodez graphics gui html ide image integer j2me japplet java javaarraylist javac javaee javaprojects jni jpanel julia jvm linked linux list loan mac map method methods mobile netbeans newbie objects online oriented output panel phone printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server service set sms software sort sql string swing test threads time transfer tree ubuntu update windows working






