Link to home
Start Free TrialLog in
Avatar of borg48
borg48

asked on

JNI and JDBC Connections

I've been trying to figure out if a JDBC Connection can be passed via jni?  My C program will call the JNI interface to connect and it will return JDBC Connection back to my C program.  Can this be done?  

Thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Can't see why not, but have to ask why?
Avatar of Konst
Konst

Why? Well, a similar thing is done in the JBoss app server for example. You specify parameters for your database connections in a JBoss config file and JBoss will then make a datasource available to clients via JNI.
This is a good thing because you can then change all your aspects of your database connections (connection pooling, timeouts,...) in a single file without having to make code changes.
Avatar of borg48

ASKER

The reason is b/c I was thinking of playing with python and they dont have any free sql server drivers like free jtds.  So if i can connect to it via jni it would be great.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial