• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

oracle database problems

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i was trying to connect to an Oracle database
but the exception occurs, this is the exception:

Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

my code is:
PreparedStatement selectStmt = null;
PreparedStatement updateOrInsertStmt = null;
String driver = "oracle.jdbc.driver.OracleDriver";
String dbUrl = "jdbc racle:thin:@192.168.0.28:1521 RA9iTST";
String user = "stage";
String pass = "stage";

Class.forName(driver);
connection = DriverManager.getConnection(dbUrl, user, pass); /*the exception is happening in this line */

please help.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Omar,
For your information, here are some details regarding the error you are getting:


12505, 00000, "TNS:listener could not resolve SID given in connect descriptor"
// *Cause: The SID in the CONNECT_DATA was not found in the listener's tables.
// *Action: Check to make sure that the SID specified is correct.
// The SIDs that are currently registered with the listener can be obtained by
// typing "LSNRCTL SERVICES <listener name>". These SIDs correspond to
// SID_NAMEs in TNSNAMES.ORA, or db_names in INIT.ORA.
// *Comment: This error will be returned if the database instance has not
// registered with the listener; the instance may need to be started.


Good Luck,
Avi.
 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Avi, you were right
i changed the dbURL to
dbUrl = "jdbc racle:thin:@192.168.0.28:1521 RA9i";
and it is now working fine.
thanks for ur time
Omar
 
reply
    Bookmark Topic Watch Topic
  • New Topic