This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Websphere and the fly likes New JDBC driver in VAJ 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "New JDBC driver in VAJ 4" Watch "New JDBC driver in VAJ 4" New topic
Author

New JDBC driver in VAJ 4

Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
Hi,
can anyone tell me how to add a new JDBC driver to the PNS
in VisualAge 4.0. It's easy to create a datasource in the PNS
if you are using a driver thats already installed but I can't
find out how to add a new driver.
thanks
Steve McCain
University of Bradford, UK
Fred Abbot
Ranch Hand

Joined: Jun 01, 2000
Posts: 300
you add the driver as a resource under options
so you put the path to the oracle driver (classes12.zip)as a resource and then it will appear as a driver when creating a datasource
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
I go to Workbench/Window/options. I click on Resources
where I enter a 'Workspace Class Path' to the driver jar
file. Then what? I can't see where you enter the driver
name. Whats more nothing has changed when I now go into
Datasources - no new driver appears. Please can someone give
me full instructions, I'm must be missing something here!
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
ps I'm trying to add the NetDirect JSQLConnect driver for
SQL Server.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Steve McCain:
I go to Workbench/Window/options. I click on Resources
where I enter a 'Workspace Class Path' to the driver jar
file. Then what? I can't see where you enter the driver
name. Whats more nothing has changed when I now go into
Datasources - no new driver appears. Please can someone give
me full instructions, I'm must be missing something here!

Even after you add the driver to the classpath (under window/options) it won't change the list of available driver classes in the list in the datasource window. That list is fixed to the ones that are supported directly by WebSphere and VAJ. You will simply have to type in the fully qualified classname of the driver yourself.
Kyle

------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
Can you just confirm that I understand this?
Its not possible to add a new driver to new driver to VAJ in
a way that it will appear in the list of available drivers
in the "Add datasource" facility of WTE?
If this is so then I assume that it is not possible to create a new datasource using the new driver that I will refer
to in my VAJ code via a lookup in the WTE name server?
I guess I don't understand this at all.
I can use this driver in WAS really easily & I want to
develop code (easily!) to deploy in WAS. I thought that VAJ
& WAS were supposed to be complimentary products!!!
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Well, it's a difference in intent. In WAS you may be able to set up a driver that's not one of the listed ones but it will NOT be supported by IBM. You are on your own as to whether or not it will work. We only support the ones in the list, and the only Sybase driver we support is the one from Sybase. As for MS SQL Server -- well it appears we only support the JDBC-ODBC driver for that.
It appears that VAJ won't even let you add one that's not supported. At one time I was pretty sure that you could type your own driver name in on the "Add Datasource" dialog, but I just verified that it appears you can't even do that in VAJ 4.0.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
Thanks for the information Kyle. The supported driver for
SQL Server seems to be the Merant SequeLink one. I'm trying
to get that working now with WAS 4. If I can get it working I'll
try to use this with VAJ4.
I did read that it was possible to add drivers & datasources
via your own code - is this a possible route for me to add
the NetDirect driver to VAJ?
Steve
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Well, it might work. Let's put it this way -- we used to allow you to do so. There's an old article on VADD (http://www7.software.ibm.com/vad.nsf/Data/Document2331?OpenDocument&p=1&BCT=3&Footer=1) that describes the procedure in VAJ 3.02. I have no idea if it still works in 3.5.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
thanks for the information, unfortunately its not straight forward. In the mean time I've tried to get the Merant driver working but I'm getting errors. I'll start a new thread
to see if anyone can help
Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
OK I've downloaded the files provided for v3 & tried it out. I imported the DataSourceFactory.jar file which overwrote the com.ibm.websphere.advanced.cm.factory class with an earlier version (yes I should of checked whether it already was there first). This resulted in the PNS not being able to start. I couldn't work out how to get the original back & ended up reinstalling VAJ.
I started again & just imported the CreateDataSource servlet. Using the html page supplied I got it to run but got errors
when the factory tried to bind (& then rebind) the new name:-

Creating a datasource failed with the exception:
javax.naming.NamingException: jdbc/WebVotingDataSource. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound java.lang.Throwable()
java.lang.Exception() org.omg.CORBA.UserException() org.omg.CosNaming.NamingContextPackage.NotFound()
org.omg.CosNaming.NamingContextPackage.NotFound
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(org.omg.CORBA.portable.InputStream) void
org.omg.ExtendedNaming._NamingContextBaseStub.rebind(org.omg.CosNaming.NameComponent [], org.omg.CORBA.Object) void
org.omg.ExtendedNaming._NamingContextStub.rebind(org.omg.CosNaming.NameComponent [], org.omg.CORBA.Object) void
com.ibm.ejs.ns.jndi.CNContextImpl.doRebind(org.omg.CosNaming.NameComponent [], java.lang.Object) void
com.ibm.ejs.ns.jndi.CNContextImpl.rebind(java.lang.String, java.lang.Object) void
com.ibm.websphere.advanced.cm.factory.DataSourceFactory.rebindDataSource(javax.sql.DataSource) void
com.ibm.ivj.servlets.CreateDataSourceServlet.performTask(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void
com.ibm.ivj.servlets.CreateDataSourceServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void
com.ibm.servlet.engine.webapp.ServicingServletState.service(com.ibm.servlet.engine.webapp.StrictLifecycleServlet, javax.servlet.ServletRequest,
javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void
com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.servlet.engine.webapp.ServletInstanceReference, javax.servlet.ServletRequest,
javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(com.ibm.servlet.engine.webapp.WebAppRequest,
javax.servlet.http.HttpServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) void com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Object) void
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lang.Object) void
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.String, com.ibm.servlet.engine.srp.ISRPConnection) void
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.servlet.engine.oselistener.api.IOSEConnection) void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.handleConnection(java.net.Socket) void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.run() void java.lang.Thread.run()
I'm not sure where to go from here, is it worth pursuing this any further?
Steve
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
I'd probably say no, it's not worth pursuing any further. If I get a chance, I might try ask the VAJ developers if they see a way around this, but I'm not hopeful...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New JDBC driver in VAJ 4