My problem is that I need to test a connection from my JSP prior to actually executing queries against the connection.
My initial solution was to have the method return a string with the error (if in fact it errors) and i would simply verify the message returned and decide if i would like to run queries against. But the problem is that in an invalid connection string, i get the exception as expected but the return string never gets returned.
Is there a method in the DriverManager that allows me to simply test the connection without it blowing up upon an invalid connection string?
But i do currently use your method, my question was more as to a way to test a connection with out causing an exception error if the connection fails. since an exception does not allow me to carry that infomation back to the jsp page for me to capture it.
We are all learning. It is not a sin if one don't know. Here
D:\oracle\ora92\jdbc\demo and unzip the zip file to any driectory you will find the file JdbcCheckup.java abd other files as well, compile it and run. Your Oracle home directory maybe different from mine (ie the D.
ypu can use this as well. Just copy and paste and compile. Remeber to change the user name, password in the connetion string.
* This sample can be used to check the JDBC installation.
* Just run it and provide the connect information. It will select
* "Hello World" from the database.
// You need to import the java.sql package to use JDBC
// We import java.io to be able to read from the command line