Connecting to Database without JDBC API

Hi,Can anybody tell me, whether it is possible to connect to a database, WITHOUT USING JDBC API? Its a question asked in an interview? I told, NO. Please clarify.Thanks,Ravindranath Y
[211 byte] By [Ravi4Javaa] at [2007-11-27 6:00:28]
# 1

> Hi,

>

> Can anybody tell me, whether it is possible to

> connect to a database, WITHOUT USING JDBC API?

Yes of course you can. It would be a stupid idea. But you can.

> Its a

> question asked in an interview? I told, NO.

Well you were wrong.

You should have said. Yes but it's stupid.

cotton.ma at 2007-7-12 16:38:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
"Cotton" answered so confidently, but seemed unable to add some explanation. What other possibilities are there? How else might it be done?I know you can access the databases by executing Runtime Processes and interpreting the InputStream. Are there better ways?
mamgeorgea at 2007-7-12 16:38:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

> "Cotton" answered so confidently, but seemed unable

> to add some explanation. What other possibilities are

> there? How else might it be done?

>

Why is there any more explanation required, the answer is right in front of you.

Do you know what a type 4 JDBC driver is? What do you think it is doing?

It is connecting directly to the database.

Usually through a socket, although this is not always the case.

> I know you can access the databases by executing

> Runtime Processes and interpreting the InputStream.

> Are there better ways?

Yes, as mentioned no third party libraries or drivers are needed. Open the socket (or pipe or whatever) and speak to the database directly.

But again it makes no sense to do this since if you can there is more than likely a type 4 driver available anyway so why re-invent the wheel.

cotton.ma at 2007-7-12 16:38:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
> "Cotton" answered so confidently, but seemed unable> to add some explanation. PS Don't ever feel the need to make such remarks about my posts ever again. I assure you will be wrong.
cotton.ma at 2007-7-12 16:38:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...