Problems accessing a SQL server data source

 

What kind of problem are you having accessing

your SQL Server database?

 

ERROR CODE: 20001 and SQL STATE: HY000

accessing SQLServer database

The problem might be that the distributed transaction coordinator service is not started. Look for an error similar to the following example when attempting to access an SQL server database

ERROR CODE: 20001
SQL STATE:  HY000
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]
[SQLServer]xa_open (0) returns -3
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) ...
at com.microsoft.jdbcx.sqlserver.SQLServerDataSource.getXAConnection
(Unknown Source) ...

To confirm this problem:

  1. Go to the Windows Control Panel and click Services(or click Control Panel > Administrative Tools > Services)

  2. Verify whether the service Distributed Transaction Coordinator or DTC is started.

  3. If not, start the Distributed Transaction Coordinator service.

 

Application fails with message stating

"Cannot find stored procedure..." accessing an SQLServer database

This error can occur because the stored procedures for the Java Transaction API (JTA) feature are not installed on the Microsoft SQL Server.

To resolve the problem: Repeat the installation for the stored procedures for the JTA feature, according to the ConnectJDBC installation guide.

 

ERROR CODE: SQL5042 when running a Java

application

This error can occur when you configure your application to run in the following manner:

  1. you use a type 2 (application) driver running on the gateway to the OS 390

  2. your application is an XA application.

OS 390 does not use XA, but uses SPM. To resolve the problem:

  1. Check your dbm cfg to see that the SPM is not started on the gateway.

  2. Assign a port and set the db2comm variable to TCPIP.

  3. Update the dbm cfg value SPM_NAME to use your machine name.

  4. Start the SPM on the gateway.


 

Related Tasks


Troubleshooting by task
Troubleshooting by component
Example: Accessing data using IBM extended APIs to share connections between container-managed and bean-managed persistence beans

 

See Also


Cannot access a data source
Problems accessing an Oracle data source
Problems accessing a DB2 database
Problems accessing a Cloudscape database
Problems accessing a Sybase data source
Extensions to data access APIs

 



 

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.