How to drop this exception?



Hi everybody,

Here is some code I've been working on...

--- code ---
String connect = "jdbc:mysql://code/db?user=me&password=none";
Driver driver = new com.mysql.jdbc.Driver();
dbc = new DatabaseConnection();
dbc.openConnection(driver, connect);
--- /code ---

Those last two lines are needed to use a custom class from some package I
received. The openConnection method expects, as you can see, a driver and a
connectionstring.

No problems for that last part - but in order to create a new Driver
object, I need to catch the SQLException which can be thrown by the Driver
constructor.

The reason to use the package in the first place was because it hides all
that and simply returns a boolean (connected / not).

Is it possible to:
a) construct a new Driver object without having to catch the SQLException
(probably not, and not a very good idea imho)
b) pass in a Driver object, and let the method handle the exceptions
c) pass in the name of a class which needs to be instantiated (best option
I guess)

Thanks in advance,

Ikke
.



Relevant Pages

  • Re: Does anyone know what this bugcheck is ? WdfDeviceInitSetReque
    ... WdfDeviceInitSetRequestAttributes configures the attributes of a WDFREQUEST that the framework will create when it receives a PIRP. ... // Create a framework driver object to represent our driver. ... If I set the above attributes to the DRIVER OBJECT in the DriverEntry ... debugger and the rest of the ...
    (microsoft.public.development.device.drivers)
  • Re: Start and stop via SCM not multiprocessor-safe?
    ... This seems to me your driver object is dereferenced and the reference count ... had dropped to zero while the DriverEntry is still active. ...
    (microsoft.public.development.device.drivers)
  • Re: Differences b/w Device Objects and Driver Objects
    ... My book is called Programming The Microsoft windows driver model. ... it describes something called the Device Objects and ... The driver object is created by the I/O ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Start and stop via SCM not multiprocessor-safe?
    ... > Do you still see your driver object at the time it bugchecked? ... > yourdriverobject) if yes, what was the pointer count and handle count of ... then the driver shouldn't have been unloaded and the stack ... I would do a BA on the DriverObject's pointer ...
    (microsoft.public.development.device.drivers)
  • Re: pooled connection myth
    ... No support is required. ... The driver should be used to obtain as much ... you can build up your own connection packaging to ... connection and one connection per driver object. ...
    (comp.lang.java.programmer)