File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anyone please tell the reason for the following exception & how to solve it

 
Ram Prasad
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me why i am getting the following exception while trying to connect to a oracle database;
Exception in thread "main" java.sql.SQLException: Invalid Oracle URL specified
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:384)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at LookUp.main(LookUp.java:15)

MY file name is Lookup.java
My code has the following lines to establish the connection

String dbUrl = "jdbcracle:thin@localhost:1521:PROJDB";
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection c = DriverManager.getConnection(dbUrl,"SYS","system");
[ February 02, 2008: Message edited by: Ram ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33689
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ram",
Please check your PM for a message from me.
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be like:



you forget a mere ":" after "thin" and before "@".
 
Ram Prasad
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Masoud,

It worked. Thank You for quick response

Ram Prasad
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic