File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes interview Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "interview Question" Watch "interview Question" New topic
Author

interview Question

taash mg
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
Hi,
Recently in an interview i was asked "what would happen if u have a driver that doesn't match ur jbdc specs and it is the one u have to register?"
can anyone throw soem light please?

Thanks
Taash


Cheers<p>Taash<br />SCJP2
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
I see two possible things you can do, assuming you have to use that driver:
1. Use it but then only implement the functionality that it supports.
2. Extend some of the classes in it (if you can) to support the functionality you need.
I'm assuming here that they meant an older driver and a newer JDBC version, or a new driver with an old JDBC version. Although I would expect the first situation to work (the JDBC should be backwards compatiable) the second might not (the driver might not work with older versions).
Hope I understood the question correctly.


Dave
taash mg
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
Hi Dave,
but will the Driver Manager register such a driver, or throw some errors while compilation?

Cheers

Taash
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Taash
It shouldn't be a problem, you're not changing the class name or anything, just adding some code to it. Possible adding a class or two to the package and then putting in the appropriate calls to the new methods into the existing class(es).
Keep in mind, I've not had to do this ever, but I don't see why it couldn't be done. I'm sure it's harder than I'm making it sound though
There are probably even better solutions too, someone might post one here.
The other option is to find an appropriate driver that does do what you need it to do and then present it to whoever decides those things and convince them to let you use that ne instead of the other one. Depending on why they asked you the question that might be the type of answer theya were looking for - one that illustrates your people skills. The best bet ina situation liek that is to give the interviewer several decent answers - they will understand that they are spur of the moment and it'll help to show them that you are a fast thinker and can come up with multiple solutions of different types.
[ July 12, 2002: Message edited by: Dave Vick ]
taash mg
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
Thanks Dave!
Sadly it was technical online stuff, i was highly confused as it was timed too and i was probably nervous and not thinking clearly Lost this one..
but learned for the next time.. Thanks to u
Cheers
Taash
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: interview Question
 
Similar Threads
about Pramati interview
guide me about accenture interview..
Information Needed ........Urgent
AccessControlException
patni or mastek?