Categories

JAVA DATEBASE
Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Java
Desktop
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Architecture
Migration and Modernization
E-Business Suite
Siebel
PeopleSoft Enterprise
JD Edwards World
Industries
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Primavera
ATG
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums

 



Tags

General Questions


JDBC connection to Oracle10g


I wrote a simple code in getting connection from java to oracle 10g.I have set the classpath correctly. here is the code. here is the code..  package sql; import java.sql.*; class TestConnection  { 	public static void main(String[] args)  	{ 		try 		{ 			Class.forName("oracle.jdbc.driver.OracleDriver"); 			Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:8080:XE","system","abhishek"); 			Statement stm=con.createStatement();		 			System.out.println("Connection established successfully"); 			con.close(); 		} 		catch(Exception e) 		{ 			e.printStackTrace(); 		} 	} }  At runtime iam getting this exception.... java.sql.SQLException: Io exception: Got minus one from a read call         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :112)         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :146)         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :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(T4CDriverExtensio n.java:35)         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)         at java.sql.DriverManager.getConnection(Unknown Source)         at java.sql.DriverManager.getConnection(Unknown Source)         at sql.TestConnection.main(TestConnection.java:10)  iam unable to get rid of the problem please help me ....

I did not see the following import in your code.  import oracle.jdbc.*;  If the problem persist, please knock Jdeveloper forum.  -aijaz


Related Links

XP and 8.1.7 client certification
Materialized View not refreshing
Memory allocation for SGA
Open database error
problem storing chinese characters
Oracle Data Guard 9i
Date and Time Format global for a database?
General
Java Pet Store
Bug in SQL*Plus 9.2.0.1.0 with 8.1.6 instance.
"shared memory realm" error -- cross-posted in "installation"
Oracle 9i new instance create scripts
Modify connect_timeout in tnsnames.ora ?
Oracle service won't start...
Oracle9i database
CKPT fails on startup with Error 220