ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JDBC DB2 Configurable Service Not Working - WMB V8.0.0.2

Post new topic  Reply to topic
 JDBC DB2 Configurable Service Not Working - WMB V8.0.0.2 « View previous topic :: View next topic » 
Author Message
EricCox
PostPosted: Mon Mar 17, 2014 9:53 am    Post subject: JDBC DB2 Configurable Service Not Working - WMB V8.0.0.2 Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

WebSphere Message Broker V8.0.0.2

We have a Java Compute Node using a Java Project. The Java Project uses this .properties file to access the database.

We have begun to convert services to use JDBC DB2 Configurable
Services. When testing the service I get the following error:
''java.util.MissingResourceException: Can't find resource for bundle
SETLSTG, key en_US''.

Here is the dbSTG.properties file before we began to convert to the
ConfSvc:
DB_URL=jdbc:db2://hostname1:50000/SETLSTG
DB_USER=username
DB_PWD=removed
DB_NAME=ETLTMP
DB_METHOD=DRIVER
#type 4
DB_DRIVER=com.ibm.db2.jcc.DB2Driver

Here is the dbSTG.properties file after the change:
DB_NAME=ETLTMP
DB_SERVICE_NAME=ETLSTG

The DB_NAME is being passed into queries. This was in place before any
changes and remains the same. The DB_SERVICE_NAME is the name of the
JDBC DB2 Configurable Service and is passed into the
getJDBCType4Connection Method.

Here is the Java code implementing the Configurable Service:
Code:
                                                                       
private static ResourceBundle applicationProperties2 = ResourceBundle   
.getBundle("dbSTG");                                               
                                                                       
private static String dbName = applicationProperties2.getString       
("DB_NAME");                                                           
private static String dbServiceName = applicationProperties2.getString
("DB_SERVICE_NAME");                                                   
                                                                       
public Connection createConnection() throws Exception{                 
      try
      {
         conn = getJDBCType4Connection(dbServiceName,
               JDBC_TransactionType.MB_TRANSACTION_AUTO);
   
         if (conn == null)
         {
            throw new Exception("Could not connect to database");
         }
   

      }
                                                                   
catch (Exception err)                                                 
{                                                                     
if (conn != null)                                                   
{                                                                   
try                                                                 
{                                                                   
conn.close();                                                     
} catch (Exception ex)                                             
{                                                                   
//Ignore                                                           
}                                                                   
}                                                                   
                                                                       
logger.error("Error getting the database connection", err);         
throw err;                                                           
}                                                                     
return conn;                                                         
}                                                                     

Here is the Configurable Service:
Code:

mqsichangeproperties BKR1 -c JDBCProviders -o ETLSTG -n connectionUrlFormat,connectionUrlFormatAttr1,connectionUrlFormatAttr2,connectionUrlFormatAttr3,
connectionUrlFormatAttr4,connectionUrlFormatAttr5,databaseName,
databaseSchemaNames,databaseType,databaseVersion,description,environmentParms,
jarsURL,jdbcProviderXASupport,maxConnectionPoolSize,portNumber,
securityIdentity,serverName,type4DatasourceClassName,type4DriverClassName
 -v "jdbc:db2://[serverName]:[portNumber]/[databaseName]:user=[user];
password=password];","","","","","","SETLSTG","useProvidedSchemaNames",
"DB2 Universal Database","9.1","default_Description","default_none",
"/opt/IBM/db2/V9.1/","true","0","50000","mySETLSTGSecurityIdentity","hostname1",
"com.ibm.db2.jcc.DB2XADataSource","com.ibm.db2.jcc.DB2Driver"


I need help resolving this error and getting the configurable service
working correctly. To me it looks like I have it all in the right places for it to work.

I have cataloged the db2 database and am able to successfully connect.

Thanks for all of your help,
EMC
Back to top
View user's profile Send private message
sunny_30
PostPosted: Sat Jun 07, 2014 8:18 pm    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

I have the same problem. Please let me know if you found a solution to this ?
Back to top
View user's profile Send private message
EricCox
PostPosted: Mon Jun 09, 2014 4:42 am    Post subject: PMR Open Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

I have a PMR open with IBM.

They have not been able to provide resolution.
Back to top
View user's profile Send private message
EricCox
PostPosted: Mon Jun 09, 2014 1:27 pm    Post subject: Check Things Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

Oh, I read your post more closely. If your talking about the resource bundle error check the .properties file name your using, check it exists on the server and that you reference it in the code properly. Notice the property file name in the code does not have .properties appended. It assumes that by using this java class to get the property file values etc.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jun 09, 2014 8:20 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Drop completely the properties file and set the service name in place of the DBName on the node. innocent:
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
EricCox
PostPosted: Tue Jun 10, 2014 4:53 am    Post subject: Using JCN Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

FJ,
Hello. I hope you are well.
We are using a JCN, so there is no db on the node, just the class name. I'm going to try hard coding stuff in the Java code rather than passing in from the properties file variables and see if that fixes it.
Thanks,
Eric
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JDBC DB2 Configurable Service Not Working - WMB V8.0.0.2
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.