posted 7 years ago
I have to do a small JDBC program that works with an Oracle 10g express edition installed on my computer.
I downloaded the 10.2.0.4 driver (ojdbc14.jar) from here, and i have the
following code :
I get the exception
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
, even if the service is started.
What am i doing wrong?
I downloaded the 10.2.0.4 driver (ojdbc14.jar) from here, and i have the
following code :
I get the exception
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
, even if the service is started.
What am i doing wrong?
posted 7 years ago
you should use driver oracle.jdbc.driver.OracleDriver since you are passing user name/password as arguement so no need to include same in URL
static final String DB_URL = jdbc:oracle:thin:@localhost:1521:orcl;
Shailesh
static final String DB_URL = jdbc:oracle:thin:@localhost:1521:orcl;
Shailesh
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein

It is sorta covered in the JavaRanch Style Guide. |