• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Own driver

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i have my own driver to connect to my database?

this is the question asked in an interview....

Please help me to know

Regards
 
Karan Johar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can write your own database driver, but i dont think it would be a trivial task, you will have to implement the jdbc api, and understand the underlying protocol (over socket) for connecting to database.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. I've never heard of an interview question where someone was asked to write their own database driver. It would only be a valid question if you also wrote your own database, and I can't imagine there are a large number of developers that arbitrarily create their own database.
 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Selikoff wrote:No. I've never heard of an interview question where someone was asked to write their own database driver. It would only be a valid question if you also wrote your own database, and I can't imagine there are a large number of developers that arbitrarily create their own database.


ok.

Thank you Karan and Scott

Regadrs
Anu
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Selikoff wrote:No. I've never heard of an interview question where someone was asked to write their own database driver. It would only be a valid question if you also wrote your own database...

I disagree. There's no reason why one couldn't write a JDBC driver for an existing DB if one were privy to the details of the network protocol. It would be a lot of work, as Karan pointed out, and wouldn't make a lot of sense, but it's not impossible.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:it's not impossible.


It may not be impossible, but it would certainly be a waste of time. Unless, as I said, you happen to have written your own database that no one has written a driver for.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be done: http://jtds.sourceforge.net/
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps wrote:It can be done: http://jtds.sourceforge.net/


This further proves my argument. If you're going to recreate a driver you're going to consult an existing project (or create a project of your own) so that dozens (perhaps hundreds) of developers can contribute. Your boss (or interviewer) isn't likely to come in and say "Hey, we need you to recreate the MySQL JDBC driver on your own!".
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i have my own driver to connect to my database?


Yes you can write your own driver, but as other have said it is not easy.

Your boss (or interviewer) isn't likely to come in and say "Hey, we need you to recreate the MySQL JDBC driver on your own!".


This is true. The objective of the question might have been to check if the candidate knows if this is possible, rather than to have the candidate write a JDBC driver.

It is indeed rare that a single developer would write a JDBC driver.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:This is true. The objective of the question might have been to check if the candidate knows if this is possible, rather than to have the candidate write a JDBC driver.


As an interviewer I'd prefer the applicant who told me rather than wasting time writing a driver, that he's going get get one from the database vendor. I'm all for intelligent developers, but saying you can reinvent the wheel makes me worry you could actually spend months reinventing the wheel.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a tough call. We can't look inside the interviewers head.
That is why I reacted on the answer to the literal question "can i have my own driver to connect to my database?".

Don't we, as interviewers, sometimes ask thought provoking questions - just to understand how the interviewee is thinking and making up his mind?
... and are happy with any answer, as long as the argumentation is sound?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps wrote:It's a tough call. We can't look inside the interviewers head.

That's because we aren't there. At the actual interview, we can ask for clarification. For example, "I would use a vendor or already written third party driver." If the interviewer wanted to know whether it was possible to write a driver he/she would ask a follow up question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic