Results 1 to 4 of 4
Thread: JDBC driver connection problem
- 07-10-2007, 08:33 PM #1
Member
- Join Date
- Jun 2007
- Posts
- 11
- Rep Power
- 0
JDBC driver connection problem
When I execute the below program I am getting the following error please help me..I have set class path to ojdbc14.jar also.. please help
Java Code:import java.sql.*; public class Con2{ public static void main(String a[]) throws Exception{ Driver drv=new oracle.jdbc.driver.OracleDriver(); DriverManager.registerDriver(drv); System.out.println("h"); Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521rcl","scott","tiger"); System.out.println("--connected-->"+con.getClass()); }}Java Code:Exception in thread "main" java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125)....
- 07-10-2007, 09:30 PM #2
Member
- Join Date
- Jul 2007
- Posts
- 41
- Rep Power
- 0
Most probably "listener" (Oracle's miniserver) knows about some instances and does not know about others. Check the file "listener.ora". Add missing entries and restart "listener" by invoking lsnctrl.sh(small shell with several commands).
Read docs on 'listener", "listener.ora" for more info.
- 07-10-2007, 09:40 PM #3
Check this post, it might help you to solve your problem:
JavaRanch Big Moose Saloon: Io Exception: The Network Adapter could not establish the connection
- 07-10-2007, 09:58 PM #4
Member
- Join Date
- Jun 2007
- Posts
- 91
- Rep Power
- 0
Please check this code, please:
Java Code:import java.sql.*; public class Con2{ public static void main(String a[]) throws Exception{ Driver drv=new oracle.jdbc.driver.OracleDriver(); DriverManager.registerDriver(drv); System.out.println("h"); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:rcl","scott","tiger"); System.out.println("--connected-->"+con.getClass()); }}
Similar Threads
-
ClassNotFoundException com.mysql.jdbc.Driver
By Heather in forum JDBCReplies: 4Last Post: 03-31-2010, 12:08 PM -
Jdbc Driver For Oracle
By Swamipsn in forum New To JavaReplies: 0Last Post: 08-14-2007, 04:31 AM -
JDBC Driver problem
By Swamipsn in forum New To JavaReplies: 3Last Post: 08-09-2007, 03:55 PM -
Help with JDBC driver
By Daniel in forum JDBCReplies: 2Last Post: 07-03-2007, 08:16 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks