• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connecting to database

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need t connect to oracle db 8.17
but on line :
Connection connection2 = DriverManager.getConnection(("jdbc racle:thin:@localhost:1521 rcl"), "system", "manager");

i receive receive exception :sqlexception :
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

may be there is another appropoach to connect or where is my error?


public Benchmark() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection connection1 = DriverManager.getConnection("jdbc:mysql://localhost/bidnow?user=root&password=root");
Connection connection2 = DriverManager.getConnection("jdbc racle://localhost/first:1521?user=system&password=manager");
long time1 = doInsert(connection1, 10);
long time2 = doInsert(connection2, 10);
} catch (Exception exception) {
exception.printStackTrace();
}
}
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is what the code should be.
String driverURL = new String("jdbc racle:thin:@<ip address>:1521:<schemaname>"); Connection conn = DriverManager.getConnection(driverURL, "steptoe", "Steptoe");

I think there is no mistake in your code. Just check whether the DB is up or not.

Shrikant
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic