Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

oracle error

 
jacq carballo
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made a small program that will connect to the oracle db. I also added catch blocks to find out when something goes wrong.
This is the code block:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url = "jdbc racle:thin:10.0.0.2:1433";
String username = "user";
String password = "password";
DriverManager.getConnection(url,username,password);
This is the error:
SQLException
SQLState: null
Message: Io exception: The Network Adapter could not establish the connection
Vendor:17002
when i try the same code with the sqlserver (of course i changed the first line to Class.forName(com.ms.jdbc.sql....), the url, username and password), it works just fine.
Can anyone tell me what is wrong with the code above? What can i do to remove the error?
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String url = "jdbc: oracle:thin@10.0.0.2:1433:<SID>;
I hope this helps
Nigel
[ February 14, 2002: Message edited by: Nigel Browne ]
[ February 14, 2002: Message edited by: Nigel Browne ]
 
jacq carballo
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made the code changes but this next problem came out:
SQLException:
SQLState: null
Message: Invalid Oracle URL
Vendor: 17067
I am sure that the IP address and the port number i used are correct because i telnet to them all the time (and i rechecked them to make sure i did not do any typo error).
Thanks in advance.
 
martin samm
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the connection string is missing a colon. It should be :
jdbc racle:thin:@<machineip/name>:<port>:<sid>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic