Subject Need Exception Listing for RC3 Driver
Author jbovitzii <jlb@rocsoft.com>
Hi All,

I am experimenting with replacing Interclient/Interserver with
Jaybird RC3 in a project I am currently working on Jbuilder7 using
DataExpress components.

I have current code that deals with exceptions that might be thrown
when opening the database connection. I would like to use something
similar with the Jaybird driver but could not find any documentation
regarding the Exception types that various operations throw.

Is this documented anywhere?

Any help would be appreciated...

Thanks in advance,
Jim

Example code using interclient is shown below:

try
{
ConnectionDescriptor myCD = new ConnectionDescriptor(
"jdbc:interbase://"+host+"/"+dbPath, qdUser, qdPasswd, false,
"interbase.interclient.Driver");
DB.setConnection(myCD);
DB.openConnection();

if ( !DB.isOpen() )
{
JOptionPane.showMessageDialog(null,
"ERROR: Could not connect to Server\n\n",
"Connection Error", JOptionPane.ERROR_MESSAGE);
hostTF.requestFocus();
return;
}
}
catch ( DataSetException ex )
{
ExceptionChain myChain = new ExceptionChain();
String errMsg;
myChain = ex.getExceptionChain();
if ( myChain.getException() instanceof
interbase.interclient.CommunicationException )
{
errMsg = "Server not found Error.";
}
else if ( myChain.getException() instanceof
interbase.interclient.UnknownHostException )
{
errMsg = "Could not resolve host Error.";
}
else if ( myChain.getException() instanceof
interbase.interclient.UnavailableDatabaseFileException )
{
errMsg = "Database not found Error.";
}
else if ( myChain.getException() instanceof
interbase.interclient.UnauthorizedUserException )
{
errMsg = "Unauthorized User Error.";
}
else
{
errMsg = "General Connection Issue:\n\n" +
ex.getMessage();
}
JOptionPane.showMessageDialog(null,
"ERROR: Could not connect to Server\n\n" +
errMsg, "Connection Error", JOptionPane.ERROR_MESSAGE);
hostTF.requestFocus();
return;
}