| | |
jdk1.6.0_14 and OracleXE connection problem
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Ouch, looks like I messed up big time without spotting my own mistake
Java Syntax (Toggle Plain Text)
import java.sql.*; public class OracleConnect { public static void main(String[] args) throws SQLException { try { Class.forName("oracle.jdbc.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "username", "password"); if (conn != null) { System.out.println("I am Connected to oracle database"); } conn.close(); } catch (Exception e) { System.out.println("ERROR : " + e); e.printStackTrace(System.out); } } }
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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Jul 2009
Posts: 11
Reputation:
Solved Threads: 0
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)
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)
>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.
>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.
![]() |
Similar Threads
- Vista and Connection Problem (Windows Vista and Windows 7)
- Yes. Yet another connection problem. (Viruses, Spyware and other Nasties)
- A7N8X-X MCP LAN Connection Problem (Windows NT / 2000 / XP)
- Internet Connection problem:Cable to modem to router to PC (Networking Hardware Configuration)
- AOL/router connection problem with msn messenger (Networking Hardware Configuration)
- Internet connection problem (Windows NT / 2000 / XP)
- Connection Problems (Networking Hardware Configuration)
Other Threads in the Oracle Forum
- Previous Thread: files of tables
- Next Thread: vista DSN name oracle odbc driver missing
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






