jdk1.6.0_14 and OracleXE connection problem

Thread Solved

Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: jdk1.6.0_14 and OracleXE connection problem

 
-1
  #21
Jul 29th, 2009
Ouch, looks like I messed up big time without spotting my own mistake
  1. import java.sql.*;
  2.  
  3. public class OracleConnect {
  4. public static void main(String[] args) throws SQLException {
  5. try {
  6. Class.forName("oracle.jdbc.OracleDriver");
  7. Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "username", "password");
  8. if (conn != null) {
  9. System.out.println("I am Connected to oracle database");
  10. }
  11. conn.close();
  12. }
  13. catch (Exception e) {
  14. System.out.println("ERROR : " + e);
  15. e.printStackTrace(System.out);
  16. }
  17. }
  18. }
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 11
Reputation: hims4u is an unknown quantity at this point 
Solved Threads: 0
hims4u hims4u is offline Offline
Newbie Poster

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #22
Jul 29th, 2009
@ sos and Peter_budo ,what should i do now??
plzz somebody help me in this.

plzz post ur answers.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 11
Reputation: hims4u is an unknown quantity at this point 
Solved Threads: 0
hims4u hims4u is offline Offline
Newbie Poster

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #23
Jul 29th, 2009
when i typed the two commands on cmd prompt, i got these errors:
it successfully got compiled but did run and gave the following errors!!!!

E:\test>javac -cp ojdbc14.jar OracleConnect.java
E:\test>java -cp .;ojdbc14.jar OracleConnect
ERROR : java.sql.SQLException: Io exception: Got minus one from a read call
java.sql.SQLException: Io exception: Got minus one from a read call
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.jav
:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java
414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensi
n.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at jdbc1.main(jdbc1.java:12)
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,617
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 466
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #24
Jul 29th, 2009
>it successfully got compiled but did run and gave the following
>errors!!!!

This is no longer a problem with your classpath setting which you were initially facing. Since it's an IOException, there might have been a lot of things going wrong here like the database not properly set to listen to connections etc. It would be kinda difficult to come up with a solution for us; do a web search for the given exception "Io exception: Got minus one from a read call" and check out the suggestions given there.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Oracle Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC