HP3000-L Archives

March 2001, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Larry LaForge <[log in to unmask]>
Reply To:
Larry LaForge <[log in to unmask]>
Date:
Wed, 14 Mar 2001 08:50:06 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
A while back, I asked this list how one would go about accessing data
bases on other platforms (like NT) from a program running on the HP3000. I
received several replies suggesting among other things, using JDBC.  I now
have be able to do this.

My goal is to integrate Oracle data on an NT server (actually Peoplesoft
data) with an application running on the HP3000 using Image.  Currently
this data must be bridged every night using ftp.  I would like the data to
be available immediately.

From Oracle, I downloaded their type 4 pure JAVA JDBC driver.  Link to
http://technet.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm
if you're interested.  After downloading the zip file, I created a jar
file in uncompressed format (option cf0); the HP response center
recommended this.  I then transferred this jar file to the HP3000 in
bytestream format into the directory /JAVA/PUB/test.  I wrote a test
program as follows:

import java.sql.*;
import java.math.*;

class TestOra {

  public static void main(String[] args)
     throws ClassNotFoundException, SQLException
  {
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ());

    Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@psoft-dev:1521:test",
"sysadm", "password");

    // Query the employee names
    Statement stmt = con.createStatement ();
    ResultSet rset = stmt.executeQuery ("select * from ps_personal_data
order by 2");

      // Print the name out
    while (rset.next ())
      System.out.println (rset.getString (2) + " " + rset.getString (1));

    con.close();

  }
}

Compile this in the shell:

$ export classpath=/JAVA/PUB/test/oracle.jar
$ /usr/local/java/latest/bin/javac TestOra.java

Finally make sure network services on the HP3000 can resolve the server on
which the Oracle data base lies.

The result of this program was a listing of employee names and ID's.

||            ||
||     ||     ||    Larry LaForge                 Hitchiner Manufacturing
Co.
||\\ || //||    Phone:  (603) 673-1100 x2312 Elm Street
|| \\||// ||    Fax:        (603) 673-0827          Milford, NH  03055
||     ||     ||    E-Mail:   [log in to unmask] Web: www.hitchiner.com
       ||

ATOM RSS1 RSS2