Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLMX JDBC connectivity

1,801 views
Skip to first unread message

kish...@gmail.com

unread,
Jul 26, 2012, 9:32:12 AM7/26/12
to
Hi All,
I want to connect my SQL/MX database thru the JDBC driver(v 5.0). Can someone tell me what are the setup required to achieve this?

Keith Dick

unread,
Jul 28, 2012, 12:04:47 AM7/28/12
to
kish...@gmail.com wrote:
> Hi All,
> I want to connect my SQL/MX database thru the JDBC driver(v 5.0). Can someone tell me what are the setup required to achieve this?

I'm not sure what level of detail you want. In case you just do not know what product to use, I think you need to use the SQL/MX Connectivity Service. There is a manual titled "HP NonStop SQL/MX Connectivity Service Manual" that describes the product. I have not installed or used it, so I cannot help with details about it.

wbreidbach

unread,
Jul 28, 2012, 4:31:36 AM7/28/12
to kd...@acm.org
In addition you need the JDBC driver which has to be ordered separately. We are using the type 4 driver as far as I know there is also a type 2 driver available. The type 4 driver runs on most platforms like Windows, Unix or Linux.

Frans Jongma

unread,
Jul 30, 2012, 3:36:13 AM7/30/12
to
The JDBC driver (v 50.) refers to the Type 2 driver. So the assumption
is you want to run with Java on the NonStop server. The first place to look
is the JDBC/MX 5.0 for SQL/MX Programmer's manual. This can be found at
www.hp.com/go/nonstop-docs.

Kishor Ahamed

unread,
Jul 30, 2012, 4:07:18 AM7/30/12
to
Hi Thanks for your reply. ya. I have that document and tried it on same way but no luck. Here is what I have tried and where I'm stuck.

1. JDBC driver (V 5.0) installed on tandem (OSS).
2. Created a catalog, schema and SQL/MX table in Tandem (OSS) side.
3. Created a Java program to connect the above table.
4. The folder where I have my Java program in my PC same place I have kept the jdbcMx.jar file (downloaded from Tandem/OSS)
5. and when I execute I’m getting below error.


Java.lang.ClassNotFoundException: com.tandem.sqlmx.SQLMXDriver
at java.net.URLClassloader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknow Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknow Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknow Source)
at Connect2.main(Connect2.java:28

I'm using below statements in my java program to connect Tandem.

String url = "jdbc:sqlmx://170.22.108.110:18650:";
Class.forName ("com.tandem.sqlmx.SQLMXDriver").newInstance ();

- Kishor

Keith Dick

unread,
Jul 30, 2012, 10:54:34 AM7/30/12
to
Kishor Ahamed wrote:
> Hi Thanks for your reply. ya. I have that document and tried it on same way but no luck. Here is what I have tried and where I'm stuck.
>
> 1. JDBC driver (V 5.0) installed on tandem (OSS).
> 2. Created a catalog, schema and SQL/MX table in Tandem (OSS) side.
> 3. Created a Java program to connect the above table.
> 4. The folder where I have my Java program in my PC same place I have kept the jdbcMx.jar file (downloaded from Tandem/OSS)
> 5. and when I execute I�m getting below error.
>
>
> Java.lang.ClassNotFoundException: com.tandem.sqlmx.SQLMXDriver
> at java.net.URLClassloader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknow Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknow Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknow Source)
> at Connect2.main(Connect2.java:28
>
> I'm using below statements in my java program to connect Tandem.
>
> String url = "jdbc:sqlmx://170.22.108.110:18650:";
> Class.forName ("com.tandem.sqlmx.SQLMXDriver").newInstance ();
>
> - Kishor

Just going by the top line of the traceback, it was unable to find the SQLMXDriver class. That suggests either that your CLASSPATH did not include the directory in which you put jdbcMx.jar, or that jdbcMx.jar does not include the SQLMXDriver class, or possibly that you just misspelled the name of the SQLMXDriver class.

I don't know anything about using SQL/MX from Java, so I don't know whether those two Java statements are correct, but I think they could not be causing the class not to be found, unless you just misspelled the class name.

dan....@gmail.com

unread,
Jul 30, 2012, 10:55:00 AM7/30/12
to
On Thursday, July 26, 2012 4:32:12 PM UTC+3, Kishor Ahamed wrote:
> Hi All,
>
> I want to connect my SQL/MX database thru the JDBC driver(v 5.0). Can someone tell me what are the setup required to achieve this?

Hi,

I have managed to get this working (program on the same machine as DB):

String sqlmpURL = "jdbc:sqlmx:";
Class.forName("com.tandem.sqlmx.SQLMXDriver");
Connection con = DriverManager.getConnection(sqlmpURL, userName, password);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet res = stmt.executeQuery(selectQuery);

res.close();
stmt.close();
con.close();

Hope it helps.

With regards,
Dan Fat

Bill Honaker

unread,
Jul 30, 2012, 3:46:10 PM7/30/12
to
You have to include the jar file name in your CLASSPATH, either fully
qualified or relative to the CWD of your application. For example, if
the jar file is in the CWD (which it probably is)::

CLASSPATH= ... t4sqlmx.jar; ...

or

CLASSPATH= ... /programs/myapp/lib/t4sqlmx.jar; ...

JAR files, unlike windows DLL files, aren't automatically searched by
the class loader without specifying the jar file name.

Bill Honaker

unread,
Jul 30, 2012, 3:54:51 PM7/30/12
to
Also the class name for the Type 4 driver is
com.tandem.t4jdbc.SQLMXDriver.

The type 2 driver class shown in your example has to run on the
NonStop, and the DLL file must also be referenced in an approporate
environment variable:

CLASSPATH= ... /usr/tandem/jdbcMx/current/lib/jdbcMx.jar: ...
_RLD_LIB_PATH= ... /usr/tandem/jdbcMx/current/lib: ...

Again, this ONLY works if the Java program runs on the NonStop itself.
Bill

On Mon, 30 Jul 2012 01:07:18 -0700 (PDT), Kishor Ahamed
<kish...@gmail.com> wrote:

0 new messages