Author |
Message
|
Santosh_Ghalsasi |
Posted: Mon Oct 31, 2011 2:14 am Post subject: Connecting to SolidDB using message broker JCN |
|
|
Novice
Joined: 01 Feb 2011 Posts: 19
|
Hi,
I want to connect to SolidDB version 6.5.0.6 using message broker JCN.
Following steps have been done.
1. I have written the code to register and connect to solid DB using Type 4 JDBC driver. For this I have got - SolidDriver2.0.jar as driver.
2. I have added the path of jar file into CLASSPATH variable.
3. The version of Message broker is 6.1.0.2
4. When I am running the flow, I am getting exception - java.lang.ClassNotFoundException: solid.jdbc.SolidDriver
at line - java.sql.Driver d = (java.sql.Driver)Class.forName("solid.jdbc.SolidDriver").newInstance();
5. The code was tested successfully long back on broker version 6.1.0.9.
6. I am not aware of what additional settings(if any) were made at that time.
I want to know if 6.1.0.2 supports this type of connectivity and if it does then what are the settings to be done to make it work.
Please help me on this.
Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 31, 2011 3:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It should be fine to use any valid JDBC driver with the level of Java that your broker supports.
You SHOULD NOT put anything on CLASSPATH. It's the wrong approach in all cases.
Put it in shared-classes.
MAKE SURE TO RESTART BROKER. |
|
Back to top |
|
 |
anandsitha |
Posted: Mon Oct 31, 2011 3:52 am Post subject: |
|
|
Acolyte
Joined: 26 Jul 2011 Posts: 59
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 31, 2011 4:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Excellent link. But bear in mind
, so where the article talks about writing a program to read from solidDB outside of Broker because of ODBC/JDBC support issues, it may not be current.
It might, however, actually apply to Broker 6.1.0.2...
So, again, excellent link, but future readers pay attention to the little details. |
|
Back to top |
|
 |
Santosh_Ghalsasi |
Posted: Tue Nov 01, 2011 4:14 am Post subject: |
|
|
Novice
Joined: 01 Feb 2011 Posts: 19
|
I have gone through the link and there also it is mentioned to include the path of SolidDriver2.0.jar into CLASSPATH. I was searching on this and found that there is something called as mqsicreateconfigurableservice that can be used to create a user defined service and later you should use mqsichangeproperties and mqsisetdbparms to register in broker.
Is anybody having idea of this? |
|
Back to top |
|
 |
Santosh_Ghalsasi |
Posted: Tue Nov 01, 2011 9:33 pm Post subject: |
|
|
Novice
Joined: 01 Feb 2011 Posts: 19
|
One more point that I want to highlight is there are two versions of message broker coexisting on this box where I am trying to execute the code. 6.1.0.2 and 7.1.0.3. For these versions, JRE5 and JRE6 are also coexisting on the machine. We have differentiated these version by using two different users.
Can the coexistence of two JREs cause the problem?? |
|
Back to top |
|
 |
Santosh_Ghalsasi |
Posted: Fri Nov 04, 2011 2:55 am Post subject: |
|
|
Novice
Joined: 01 Feb 2011 Posts: 19
|
Hi,
It worked for me
I reconfigured the classpath of driver and restarted the broker.
No other settings are required.
Thanks all for your suggestions.!! ) |
|
Back to top |
|
 |
Santosh_Ghalsasi |
Posted: Thu Nov 17, 2011 12:38 am Post subject: |
|
|
Novice
Joined: 01 Feb 2011 Posts: 19
|
Hi,
I am trying to connect to Solid DB using getJDBCType4Connection method. For this I have followed below steps.
1. created a configurable service using mqsicreateconfigurableservice.
parameters that are usedwith option -n are(with respective values in -v option)
databaseType,
connectionUrlFormat,
description,
jarsURL,
portNumber,
serverName,
type4DatasourceClassName,
type4DriverClassName
2. Put SolidDriver2.0.jar file at the path mentioned in jarsURL parameter
3. Stopped and started the broker.
This works for me when I use below format of connectionUrlFormat
jdbc:solid://<DB_IP>:<port>/<user>/<pwd>
SolidDB has a concept of connection switch. Means it has two databases- Primary and Secondary. If primary DB fails for some reason, or could not be connected, one should try to connect to Secondary.
For this setting, the connectionUrlFormat should be as below
jdbc:solid://<DB_IP1>:<port1>,<DB_IP2>:<port2>/<user>/<pwd>
When I am using mqsichangeproperties to change this property it is only taking the string till comma - jdbc:solid://<DB_IP1>:<port1>
I tried with ';' instead of ',' but its not working.
Please help me if anyone have idea on this.
Thanks, |
|
Back to top |
|
 |
saurabh867 |
Posted: Thu Nov 17, 2011 3:29 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Hi,
As you mentioned that you are doing this in JCN (java class), did you try to test it using a simple java class?
If you can connect from the simple java program than use the same code snippet with broker.
I think you should be able to connect then. Either deploy the jar file along with your bar file or place it in shared classes.
Regards,
Saurabh |
|
Back to top |
|
 |
|