IBM ERRORCODE=-4499, The application server rejected establishment of the connection. - United States -4499; JCC; SQL State = 08004; Error Code = -4; 499 TECHNOTE (TROUBLESHOOTING)

PROBLEM(ABSTRACT)
 
Attempt to connect to a database using Type 4 JCC driver fails with the following exception:

java.sql.SQLException: 
[jcc][t4][2057][11264][3.53.95] The application server rejected establishment of the connection. An attempt was made to access a database, <database name>, which was either not found or does 
not support transactions. ERRORCODE=-4499, 
SQLSTATE=08004 DSRA0010E: SQL State = 08004, Error Code = -4,499 



CAUSE
Using DCS DB alias or local alias name of the database in the connection string will cause this error.

RESOLVING THE PROBLEM
 

The URL format for IBM Data Server Driver for JDBC and SQLJ type 4 connectivity is:


 *  "jdbc:db2://<server name>: <portnumber>/<database name>"; 


In the Type 4 JDBC JCC driver connection string used, 
 *  If the connection is to a DB2 for Linux,Unix,Windows server, the database name should be the Target database name in the database server, it should not be the local alias name cataloged in the client. 
 *  If the connection is to a DB2 for z/OS server, database name is the DB2 location name that is defined during installation. All characters in the DB2 location name must be upper-case characters. The IBM Data Server Driver for JDBC and SQLJ does not convert lower-case characters in the database value to upper-case for IBM Data Server Driver for JDBC and SQLJ type 4 connectivity. 
 * The location name can be found by executing the following SQL statement on the server:  * SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1;
   
   
   The target database name can also be found from the DCS directory on the client using the command:  * db2 list dcs directory.
   
   



[/support/docview.wss?uid=swg21443723&aid=1] [/support/docview.wss?uid=swg21443723&aid=1] 
For further discussion on this topic, visit this developerWorks forum thread: 
https://www.ibm.com/developerworks/community/forums/html/topic?id=1cd04237-a9dd-4061-9c38-f9043786691a [https://www.ibm.com/developerworks/community/forums/html/topic?id=1cd04237-a9dd-4061-9c38-f9043786691a] 
RELATED INFORMATION
 Type 4 JCC connection String: [http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html]
What could cause a "Connection refused" to SQLDB/DB2 after some time? I have deployed an WAS Liberty/ JPA application. Everything is fine, and after a while (a day or 2), I get the connection refused exception: java.sql.SQLNonTransientException: [jcc][t4][2043][11550][4.14.103] Exception java.net.ConnectException: Error opening socket to server /XX.XXX.XXX.XXXon port 50,000 with message: Connection refused. ERRORCODE=-4499, SQLSTATE=08001 DSRA0010E: SQL State = 08001, Error Code = -4,499 
Any idea what could cause this issue?
Using DCS DB alias or local alias name of the database in the connection string will cause this error.