Hi.
>
> I have a jdbc problem. I create a Connection object from a Datasource or a
Driver manager. Everything works except when i purposefully enter the incorrect
user name or password, the program crashes.I catch a SQLException and an
interbase specific UserUnauthorisedException but none of these catch statement
are reached. I even tried a general Exception.
>
> Do you have any idea why the try-catch block is ignoring the exception being
thrown. ....Or is there another way of veryfying a user and a password upon
login.
>
> Here is the code segment.
>
>
> try {
> interbase.interclient.DataSource dataSource = new
interbase.interclient.DataSource();
> javax.sql.DataSource ds = null;
> dataSource.setNetworkProtocol("jdbc:interbase:");
> dataSource.setServerName(server);
> dataSource.setDatabaseName(path);
> dataSource.setDataSourceName(sname);
> dataSource.setDescription("A different way");
> dataSource.setPortNumber(portnumber);
> dataSource.setRoleName(role);
> dataSource.setLoginTimeout(30);
>
>
> ds = (javax.sql.DataSource)dataSource;
> System.out.println("Exception check!!!");
> java.sql.Connection tmpc = ds.getConnection(login,passwd);
> System.out.println("Exception check2!!!");
> c = tmpc;
> }
> catch ( interbase.interclient.UnauthorizedUserException use )
> {
> System.err.println("Exception creating the database connection: ");
> System.out.println(use.getMessage());
> }
> catch ( java.sql.SQLException se )
> {
> System.err.println("Exception creating the database connection: ");
> System.out.println(se.getMessage());
> }
> catch ( Exception e )
> {
> System.err.println("Exception creating the database connection: ");
> System.out.println(e.getMessage());
> }
>
> I tried it with the DriverManager class as well. The exception is stil not
caught.
>
> Thanks
> Micah