Sunday, August 2, 2009

Java Database Connectivity beginner question?

alright guys, i have a simple employee table in oracle and I can run the simple java codes on my machine





in order to make java read the table what should i do ?


version: Java\jdk1.6.0_03





I have the ojdbc14.jar which i imagine is the driver; its location is


C:\Program Files\Java\jdk1.6.0_03\jre\lib\ext





is this the correct location ?


do i need a connector in addition to driver ?


why my program is not working ? i get this message :





C:\Program Files\Java\jdk1.6.0_03\jre\lib\ext%26gt;java MainScreen





Could not Load JDBC driver


java.sql.SQLException: Io exception: Invalid connection string format, a valid f


ormat is: "host:port:sid"


Exception in thread "main" java.lang.NullPointerException


at MainScreen.%26lt;init%26gt;(MainScreen.java:84)


at MainScreen.main(MainScreen.java:217)





what is missing here ? what should i add or delete ? what changes are necessary ?





Explanations from scratch would be appreciated ? if you know any good source which explains it please

Java Database Connectivity beginner question?
As the exception told you, you have an invalid connection string,


and this basically means that you need to learn how to work with the JDBC api, and this is a good link to begin with:


http://java.sun.com/developer/onlineTrai...
Reply:You have to correct your connection string


visit http://www.connectionstrings.com to search for correct connection string or also look at http://www.carlprothman.net/Default.aspx...

survey monkey

No comments:

Post a Comment