weblogic server using jdbc-odbc bridge

I want to connect to database through jdbc-odbc bridge.I am using web logic server. When i creating new jdbc connection pool a error comes that driver class is not on classpath. how i rectify this problem? how I make weblogic to recognize sun.jdbc.odbc.JdbcOdbcDriver?
[275 byte] By [funtoosh_khilaria] at [2007-11-26 19:47:46]
# 1
like any other library...put the .jar file of the lib in the WEB-INF/lib of your webapp
alban.maillerea at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

> like any other library...

> put the .jar file of the lib in the WEB-INF/lib of

> your webapp

Wrong in so many ways.

You don't add drivers to WEB-INF/lib if they're being acquired as datasources - the server needs access to the driver to create the data source. If you're not using a DataSource but materializing the connection directly, then this advice is semi-correct, but it's a crappy way to build a web app.

You don't normally add a JAR for the Sun JDBC ODBC bridge anyway as it's present by default in their J2SE implementation.

And finally, I think WebLogic doesn't use the Sun J2SE implementation anyway, so it's possible that the bridge is not available at all.

So the correct answer is: Don't use the bridge driver. Acquire a driver for your specific database and use that. And make sure that it's available to the application server. If you absolutely must use the bridge driver, you're going to have to use the Sun J2SE implementation to run WebLogic - and I think you'll have to consult the WebLogic site for help with that.

dcmintera at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
why wouldn't he manage is own datasource?there is a world between server managed pooled datasources and DriverManager.getConnection
alban.maillerea at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

> why wouldn't he manage is own datasource?

Because in a server application it's bad practice.

> there is a world between server managed pooled

> datasources and DriverManager.getConnection

True. And a webapp is no place for the latter. Note that this has nothing to do with connection pooling considerations.

dcmintera at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
thanks for the note...note that sometime in a certain professional context, you don't really have the choice.the bad practice, as far as I know, is to apply the good practices mindlessly
alban.maillerea at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6

> note that sometime in a certain professional context,

> you don't really have the choice.

Huh? Such as?

The only circumstances I can imagine under which you'd have this obligation is if you're condemned to work with an application that already does this. In which case someone else has already made an unprofessional choice.

> the bad practice, as far as I know, is to apply the

> good practices mindlessly

What benefits do you believe accrue from acquiring connections directly?

dcmintera at 2007-7-9 22:34:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 7
forget about what i said... after all you're the expert
alban.maillerea at 2007-7-9 22:34:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 8

> > note that sometime in a certain professional

> context,

> > you don't really have the choice.

>

> Huh? Such as?

Such as "I'm being paid to do a job that I have no fsking clue how to do correctly, so I'll beat it with a hammer until it works."

bckrispia at 2007-7-9 22:34:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 9

> > > note that sometime in a certain professional

> > context,

> > > you don't really have the choice.

> >

> > Huh? Such as?

>

> Such as "I'm being paid to do a job that I have no

> fsking clue how to do correctly, so I'll beat it with

> a hammer until it works."

And if it doesn't work get a BFH (Bigger F*cking Hammer). ;-)

masijade.a at 2007-7-9 22:34:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 10

> Such as "I'm being paid to do a job that I have no

> fsking clue how to do correctly, so I'll beat it with

> a hammer until it works."

:-)

The only one I can think of is that it's easier in the short term. So it might be just about suitable for a really simple prototype that will never be deployed elsewhere. Except that the marginal difference is pretty slight once you know how to set up a data source, so even then I doubt it's really worth it, particularly given the tendancy for prototype code to get sucked into the end project.

dcmintera at 2007-7-9 22:34:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 11

> The only one I can think of is that it's easier in

> the short term. So it might be just about suitable

> for a really simple prototype that will never be

> deployed elsewhere.

Famous last words: "This is just sloppy prototype code. It'll never make it in to production."

;-)

bckrispia at 2007-7-9 22:34:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...