wood burning stoves 2.0*
The moose likes Websphere and the fly likes Merant JDBC drive for SQL Server & WAS 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Merant JDBC drive for SQL Server & WAS 4" Watch "Merant JDBC drive for SQL Server & WAS 4" New topic
Author

Merant JDBC drive for SQL Server & WAS 4

Steve McCain
Ranch Hand

Joined: Sep 03, 2001
Posts: 45
I've been using the NetDirect driver to connect to a SQL Server 7
driver. I'm now trying the Merant driver but am now getting errors, eg from the supplied WebSphereSamples/YourCo I get
An Error Occurred While Processing Your Request...
The following error has been detected:
java.lang.Exception: Error getting a database connection:
java.sql.SQLException: [MERANT][SequeLink JDBC Driver][SQL Server]
internal error: Data source name not found and no default driver specified
Full Stack Trace:
java.lang.Exception: Error getting a database connection: java.sql.SQLException: [MERANT][SequeLink JDBC Driver][SQL Server]internal error: Data source name not found and no default driver specified
at WebSphereSamples.YourCo.HitCounter.HitCounterBean.doHitsIncrement(HitCounterBean.java:165)
at WebSphereSamples.YourCo.HitCounter.HitCounterBean.getHitsIncrement(HitCounterBean.java:54)
at YourCo.index_jsp_0._jspService(index_jsp_0.java:166)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:286)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

The Merant driver and the SequeLink 5.1 server were installed as per the WAS 4 instructions. I really can't see whats wrong here.
Any advice will be very welcome!!
Steve McCain
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
OK, would you begin by posting the part of your server-cfg.xml file that is between the <resourceProviders> </resourceProviders> sections? There might be several -- please show all of them.
Then, would you mind looking in your ejb-jar.xml file for the deployed samples and showing us what datasource you are using?
Thanks.
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
Kyle,
hope this is what you need - not sure which sections you mean.
Also I don't have a ebj-jar.xml.

from server-cfg.xml ......

<resourceProviders xmi:type="resources:JDBCDriver" xmi:id="JDBCDriver_1" name="Db2JdbcDriver" description="DB2 JDBC Driver" implementationClassName="COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource" urlPrefix="jdbc:db2">
- <factories xmi:type="resources ataSource" xmi:id="DataSource_1" name="Session Persistence datasource" jndiName="jdbc/Session" description="Data source for session persistence" category="Samples" jtaEnabled="false" databaseName="Session" minimumPoolSize="1" maximumPoolSize="30" connectionTimeout="180" idleTimeout="1800" orphanTimeout="1800">
<propertySet xmi:id="DataSource_1_ps" />
</factories>
<propertySet xmi:id="JDBCDriver_1_ps" />
</resourceProviders>
- <resourceProviders xmi:type="resources:JDBCDriver" xmi:id="JDBCDriver_2" name="idbJdbcDriver" description="instantDB JDBC Driver" implementationClassName="com.ibm.ejs.cm.portability.IDBConnectionPoolDataSource" urlPrefix="jdbc:idb">
- <factories xmi:type="resources ataSource" xmi:id="DataSource_2" name="Increment Bean Datasource" jndiName="jdbc/SampleDataSource" description="Increment Bean Datasource" category="Samples1" jtaEnabled="false" minimumPoolSize="1" maximumPoolSize="10" connectionTimeout="180" idleTimeout="1800" orphanTimeout="1800">
- <propertySet xmi:id="DataSource_2_ps">
<resourceProperties xmi:id="J2EEResourceProperty_1" name="url" type="java.lang.string" value="jdbc:idb:e:\WebSphere\AppServer/bin/sampleDB.prp" />
</propertySet>
</factories>
- <factories xmi:type="resources ataSource" xmi:id="DataSource_3" name="Samples IDB Datasource" jndiName="jdbc/sample_IDB" description="Samples Gallery IDB Datasource" category="Samples" jtaEnabled="false" minimumPoolSize="1" maximumPoolSize="10" connectionTimeout="180" idleTimeout="1800" orphanTimeout="1800" statementCacheSize="100" disableAutoConnectionCleanup="false">
- <propertySet xmi:id="DataSource_3_ps">
<resourceProperties xmi:id="J2EEResourceProperty_2" name="url" type="java.lang.string" value="jdbc:idb:e:\WebSphere\AppServer/installedApps/Samples.ear/IDBDatabase/sample.prp" />
</propertySet>
</factories>
- <factories xmi:type="resources ataSource" xmi:id="DataSource_4" name="Petstore IDB Datasource" jndiName="ps/PetStoreDatasource" description="Petstore IDB Datasource" category="Samples" jtaEnabled="false" minimumPoolSize="1" maximumPoolSize="10" connectionTimeout="180" idleTimeout="1800" orphanTimeout="1800">
- <propertySet xmi:id="DataSource_4_ps">
<resourceProperties xmi:id="J2EEResourceProperty_3" name="url" type="java.lang.string" value="jdbc:idb:${WASROOT}/installedApps/Samples.ear/IDBDatabase/sample.prp" />
</propertySet>
</factories>
<propertySet xmi:id="JDBCDriver_2_ps" />
</resourceProviders>
- <resourceProviders xmi:type="resources:URLProvider" xmi:id="URLProvider_1" name="Default URL Provider" description="The default internal URL Provider that may be used to create URL Factories. This provider's StreamHandler class name and protocol must be set to 'unused' in order for it to be valid" streamHandlerClassName="unused" protocol="unused">
<propertySet xmi:id="URLProvider_1_ps" />
</resourceProviders>
- <resourceProviders xmi:type="resources:MailProvider" xmi:id="MailProvider_1" name="Default Mail Provider" description="The default internal Mail Provider that may be used to create Mail Sessions">
<propertySet xmi:id="MailProvider_1_ps" />
</resourceProviders>
- <resourceProviders xmi:type="resources:JDBCDriver" xmi:id="JDBCDriver_5" name="MerantJdbcDriver" description="Microsoft SQL Server via Merant SequeLink JDBC Driver (both one and two phase commit). Specify classpath as (PATH)/sljc.jar;(PATH)/sljcx.jar on Windows, or (PATH)/sljc.jar PATH)/sljcx.jar on UN*X platforms. This driver can be used to connect to MS SQL Server databases." implementationClassName="com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource">
<urlPrefix xsi:nil="true" />
- <factories xmi:type="resources ataSource" xmi:id="DataSource_5" name="SQL Server Samples DataSource" jndiName="jdbc/sample" description="Sample Gallery SQL Server DataSource" category="Samples" jtaEnabled="false" databaseName="SAMPLE" minimumPoolSize="1" maximumPoolSize="10" connectionTimeout="180" idleTimeout="1800" orphanTimeout="1800" statementCacheSize="100" defaultUser="WSDEMO" defaultPassword="{xor}KCw7OjIwbg==" disableAutoConnectionCleanup="false">
- <propertySet xmi:id="J2EEResourcePropertySet_1">
<resourceProperties xmi:id="J2EEResourceProperty_4" name="serverName" type="java.lang.String" value="localhost" description="The name of the server where SequeLinkServer resides, such as 'MyServer'" />
<resourceProperties xmi:id="J2EEResourceProperty_5" name="portNumber" type="java.lang.Integer" value="19996" description="The TCP/IP port SequeLinkServer uses for communication. By default, SequeLinkServer uses port 19996." />
<resourceProperties xmi:id="J2EEResourceProperty_6" name="disable2Phase" type="java.lang.Boolean" value="true" description="When false (by default), two phase connections are used. When true, one phase connections are used." />
</propertySet>
</factories>
<propertySet xmi:id="J2EEResourcePropertySet_3" />
</resourceProviders>
- <resourceProviders xmi:type="resources:JDBCDriver" xmi:id="JDBCDriver_3" name="NetDirectJdbcDriver" description="NetDirect JDBC driver for SQL Server (Type 4)" implementationClassName="com.jnetdirect.jsql.JSQLConnectionPoolDataSource">
<urlPrefix xsi:nil="true" />
- <factories xmi:type="resources ataSource" xmi:id="DataSource_6" name="NetDirect SQL Server Samples DataSource" jndiName="jdbc/NDsample" description="Sample Gallery SQL Server DataSource" category="Samples" jtaEnabled="false" databaseName="SAMPLE" minimumPoolSize="3" maximumPoolSize="20" connectionTimeout="30" idleTimeout="300" orphanTimeout="120" statementCacheSize="100" defaultUser="wsdemo" defaultPassword="{xor}KCw7OjIwbg==" disableAutoConnectionCleanup="false">
- <propertySet xmi:id="J2EEResourcePropertySet_4">
- <resourceProperties xmi:id="J2EEResourceProperty_7" name="serverName" type="java.lang.String" value="localhost">
<description xsi:nil="true" />
</resourceProperties>
</propertySet>
</factories>
<propertySet xmi:id="J2EEResourcePropertySet_2" />
</resourceProviders>
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Kyle Brown:
Steve,
From the previous post it appears that you successfully created a database driver and Datasource named "jdbc/NDSample". I think now you need to go into the configuration of the "yourco" EJB's and set the default datasource to be the new one (jdbc/NDSample) if you want to try them with SQL server.
BTW -- ejb-jar.xml is inside of each EJB Jar file.
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
the WebSphereSamples/YourCo sample application supplied with
WAS uses jdbc/sample as the JDBC datasource. I created this datasource to use the NetDirect driver - this was the only difference in migrating the samples to SQL Server from the supplied instructions (see Database Configuration Tasks 1 to 4 accessed from the WebSphere samples page, accessed from the 'First Steps' application.
It all worked fine using the NetDirect driver.
To test out the Merant driver I changed the datasource name to
jdbc/NDsample because of course the names in the JNDI must be unique and then created the jdbc/sample datasource to use the Merant driver. This can be seen as DataSource_5 in the
server-cfg.xml.
I thought the beauty of using DataSource names in code that
connects to databases is that you can just change the datasource
definition to change the driver or the physical database or even the RDBMS you are dealing with without changing the code - I assumed I could just change the jdbc/sample datasource and the supplied code would work without amendment - if the ejb-jar.xml files refer the jdbc/sample then I'd prefer just to leave them as they are.
Thanks
Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Merant JDBC drive for SQL Server & WAS 4
 
Similar Threads
WAS4.0 Problems connecting to Oracle using Merant Drivers
Attn:kyle-A resource was unable to process the two phase commit (Urgent)
X Servlet Error: Servant is not of the expected type.: org.omg.CORBA.BAD_PARAM:
WebSphere Examples from sg246292
very urgent...websphere 4.0