i have a few questions about JDBC and Oracle, please help me. thanks. 1. What is the DB name? How can i know it. 2. i want to connect the oracle db throuhg java, but i always got exception(Connection refused). Following is the code snip. -------------------------------------------- Class.forName ("oracle.jdbc.driver.OracleDriver"); System.out.println( "Driver loaded!" ); Connection conn = DriverManager.getConnection ("jdbc:oracle:???:@???", "scott", "tiger") --------------------------------------------- please tell me what should i fill in '?' place. I ma using oracle8.0.5, and win2k. thanks [ Edited to fix ] [ April 11, 2002: Message edited by: David O'Meara ]
Beksy Kurian
Ranch Hand
Joined: Jul 11, 2001
Posts: 254
posted
0
jdbc:oracle:thin:@youripaddress:1521:youroraclesid provided you have Oracle thin driver installed Hope it helps! Beksy [ Edited to fix ] [ April 11, 2002: Message edited by: David O'Meara ]
kris iyer
Greenhorn
Joined: Mar 27, 2002
Posts: 5
posted
0
Hi For running the jdbc type 4 driver you may have to add the classes111.zip or classes12.zip to ur classpath DB name is the database name to which you r connecting. you can get it from the TNSname.ora bye kris
"ordin", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp. We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements. Thanks. Dave
If that doesn't work, try going to Services in Administrative Tools from Control Panel and scroll down until you see the Oracle services. From there, you should be able to determine the SID.
fei long
Ranch Hand
Joined: Apr 04, 2002
Posts: 48
posted
0
yes, yes. i really tried those ways, but i failed. java always give me 'java.sql.SQLException: Connection refused' Is there any way to check if i can connect to oracle db? thanks.
Originally posted by ordin: yes, yes. i really tried those ways, but i failed. java always give me 'java.sql.SQLException: Connection refused' Is there any way to check if i can connect to oracle db? thanks.
connect via SQL*Plus editor. Use the same parameters in your connection. This should eliminate any permission problems/naming problems. Jamie
fei long
Ranch Hand
Joined: Apr 04, 2002
Posts: 48
posted
0
hello Jamie, could you tell me how to do in detail?(i mean step by step)