Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-11 Thread Andrew Raibeck

It isn't as if there is any specific opposition to creating a JDBC driver.
There just has not been a big demand for it. You might consider entering a
requirement, either through your IBM rep or SHARE.

But just because there is no JDBC driver doesn't mean that you can't write
in-house code to query the TSM server. C/C++ does the job quite nicely,
and uou can't get much more direct than that.

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: [EMAIL PROTECTED] (change eye to i to reply)

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.


Date:Fri, 10 May 2002 13:33:20 -0700
From:Gerald Wichmann <[EMAIL PROTECTED]>
Subject: Re: JDBC-ODBC Bridge and TSM ODBC driver

With IBM's pro-java stance I've always found it odd that TSM doesn't have
better JDBC support. It really makes it difficult for a company to write
in
house code to query the TSM server DB for info and use it. Outside of
using
SNMP software and decision support to monitor/report a TSM server why
doesn't IBM support some more direct means of doing so like via the use of
JDBC support? I've always found that odd...

Regards,

Gerald Wichmann
Senior Systems Development Engineer
Zantaz, Inc.
925.598.3099 (w)

-Original Message-
From: Andrew Raibeck [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: JDBC-ODBC Bridge and TSM ODBC driver

You need to use the JDBC <--> ODBC bridge. There is no JDBC driver for
TSM, nor do we plan on implementing one at this time.




Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-10 Thread Gerald Wichmann

With IBM's pro-java stance I've always found it odd that TSM doesn't have
better JDBC support. It really makes it difficult for a company to write in
house code to query the TSM server DB for info and use it. Outside of using
SNMP software and decision support to monitor/report a TSM server why
doesn't IBM support some more direct means of doing so like via the use of
JDBC support? I've always found that odd...

Regards,

Gerald Wichmann
Senior Systems Development Engineer
Zantaz, Inc.
925.598.3099 (w)

-Original Message-
From: Andrew Raibeck [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: JDBC-ODBC Bridge and TSM ODBC driver

You need to use the JDBC <--> ODBC bridge. There is no JDBC driver for
TSM, nor do we plan on implementing one at this time.

Which version of the ODBC driver are you using? The only ones that I know
of that work (to at least some minimal degree) are 5.1.0.1 and now
4.2.2.0. Any future versions should also work. Note that we do not perform
extensive testing with the bridge, so we do not formally support it, and I
can not guarantee results. However, I can at least issue a select
statement and get results back.

I haven't worked with Java in at least 2 years (and am extremely rusty),
and I have almost zero experience with the JDBC-ODBC bridge. However, I
did pick up a book by Gregory D. Speegle called "JDBC Practical Guide for
Java Programmers" which gives information on how to do this.

Adapting an example from that book, I came up with some code that displays
the DATE_TIME and MESSAGE field from the ACTLOG table:

TSMConnect.java:

import java.sql.*;

public class TSMConnect
{
public Connection connect()
   throws SQLException
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException e)
{
throw new SQLException("Unable to load JdbcOdbcDriver class");
}

// arguments are "jdbc:odbc:yourdsn", "youradmin", "yourpw"
return DriverManager.getConnection("jdbc:odbc:amr_odbc",
   "raibeck",
   "tsm0dbc");
}

public void close(Connection dbc, Statement stmt)
{
try
{
if (stmt != null)
stmt.close();
if (dbc != null)
dbc.close();
}
catch (SQLException sqlex) {}
}

public static void main(String args[])
{
TSMConnect TC = new TSMConnect();
Connection dbc = null;
Statement stmt = null;
try
{
dbc = TC.connect();
System.out.println("Connection opened.");
stmt = dbc.createStatement();
System.out.println("Created a statement.");
}
catch (SQLException sqlex)
{
System.out.println(sqlex.getMessage());
}
finally
{
TC.close(dbc, stmt);
System.out.println("Connection closed.");
}
}
}



TSM.java:

import java.sql.*;

public class TSM extends TSMConnect
{
public static void main(String args[])
{
if (args.length != 0)
{
System.out.println("Usage: java TSM");
System.exit(1);
}

String query = "SELECT * FROM ACTLOG";

TSM tsmObj = new TSM();
Connection dbc = null;
Statement stmt = null;
ResultSet resultSet = null;

try
{
dbc = tsmObj.connect();
stmt = dbc.createStatement();
resultSet = stmt.executeQuery(query);
tsmObj.presentResultSet(resultSet);
}
catch (SQLException sqlex)
{
System.out.println(sqlex.getMessage());
}
finally
{
tsmObj.close(dbc, stmt);
}
}

public void presentResultSet(ResultSet rs)
   throws SQLException
{
if (!rs.next())
System.out.println("No records to display");
else
{
do
{
System.out.println(rs.getString("DATE_TIME") + ": " +
rs.getString("MESSAGE"));
}
while (rs.next());
}
}
}


Note that you need to put your DSN, admin ID, and admin password in the
TSMConnect.java file.

To build the code, run

   javac TSM.java

To run the code

   java TSM

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Clien

Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-10 Thread Andrew Raibeck

You need to use the JDBC <--> ODBC bridge. There is no JDBC driver for
TSM, nor do we plan on implementing one at this time.

Which version of the ODBC driver are you using? The only ones that I know
of that work (to at least some minimal degree) are 5.1.0.1 and now
4.2.2.0. Any future versions should also work. Note that we do not perform
extensive testing with the bridge, so we do not formally support it, and I
can not guarantee results. However, I can at least issue a select
statement and get results back.

I haven't worked with Java in at least 2 years (and am extremely rusty),
and I have almost zero experience with the JDBC-ODBC bridge. However, I
did pick up a book by Gregory D. Speegle called "JDBC Practical Guide for
Java Programmers" which gives information on how to do this.

Adapting an example from that book, I came up with some code that displays
the DATE_TIME and MESSAGE field from the ACTLOG table:

TSMConnect.java:

import java.sql.*;

public class TSMConnect
{
public Connection connect()
   throws SQLException
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException e)
{
throw new SQLException("Unable to load JdbcOdbcDriver class");
}

// arguments are "jdbc:odbc:yourdsn", "youradmin", "yourpw"
return DriverManager.getConnection("jdbc:odbc:amr_odbc",
   "raibeck",
   "tsm0dbc");
}

public void close(Connection dbc, Statement stmt)
{
try
{
if (stmt != null)
stmt.close();
if (dbc != null)
dbc.close();
}
catch (SQLException sqlex) {}
}

public static void main(String args[])
{
TSMConnect TC = new TSMConnect();
Connection dbc = null;
Statement stmt = null;
try
{
dbc = TC.connect();
System.out.println("Connection opened.");
stmt = dbc.createStatement();
System.out.println("Created a statement.");
}
catch (SQLException sqlex)
{
System.out.println(sqlex.getMessage());
}
finally
{
TC.close(dbc, stmt);
System.out.println("Connection closed.");
}
}
}



TSM.java:

import java.sql.*;

public class TSM extends TSMConnect
{
public static void main(String args[])
{
if (args.length != 0)
{
System.out.println("Usage: java TSM");
System.exit(1);
}

String query = "SELECT * FROM ACTLOG";

TSM tsmObj = new TSM();
Connection dbc = null;
Statement stmt = null;
ResultSet resultSet = null;

try
{
dbc = tsmObj.connect();
stmt = dbc.createStatement();
resultSet = stmt.executeQuery(query);
tsmObj.presentResultSet(resultSet);
}
catch (SQLException sqlex)
{
System.out.println(sqlex.getMessage());
}
finally
{
tsmObj.close(dbc, stmt);
}
}

public void presentResultSet(ResultSet rs)
   throws SQLException
{
if (!rs.next())
System.out.println("No records to display");
else
{
do
{
System.out.println(rs.getString("DATE_TIME") + ": " +
rs.getString("MESSAGE"));
}
while (rs.next());
}
}
}


Note that you need to put your DSN, admin ID, and admin password in the
TSMConnect.java file.

To build the code, run

   javac TSM.java

To run the code

   java TSM

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: [EMAIL PROTECTED] (change eye to i to reply)

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.

Forum:   ADSM.ORG - ADSM / TSM Mailing List Archive
 Date:  May 10, 06:20
 From:  Warren, Matthew James <[EMAIL PROTECTED]>

He TSM'ers,

Has anyone any success connecting to the TSM database using the JDBC-ODBC
bridge and the TSM ODBC drivers? I have set bot system and user
datasources
using the TSM ODBC driver, and I am then attmepting to access this from
Java
using the JDBC-ODBC bridge.

Currently I am using this code in a Main method;

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException CNFE)
{
System.out.println(CNFE.toString());
}
try
{
Connection con =
DriverManager.getConnection("jdb

Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-10 Thread Bill Boyer

Here's a post from Andy Raibeck about the TSM5.1 ODBC
driver...http://msgs.adsm.org/cgi-bin/get/adsm0204/714.html.

Bill Boyer
DSS< Inc.

-Original Message-
From: ADSM: Dist Stor Manager [mailto:[EMAIL PROTECTED]]On Behalf Of
Warren, Matthew James
Sent: Friday, May 10, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: Re: JDBC-ODBC Bridge and TSM ODBC driver


Hi Ppl,

I'm getting somehwere, but the DB access through jdbc:odbc: -> Access
databse -> TSMdatabase is incredibly slow.

I have been told that it may help to use a native JDBC inteface; I don't
think there is one for JDBC & TSM, but maybe someone knows differently?



Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-10 Thread Warren, Matthew James

Hi Ppl,

I'm getting somehwere, but the DB access through jdbc:odbc: -> Access
databse -> TSMdatabase is incredibly slow.

I have been told that it may help to use a native JDBC inteface; I don't
think there is one for JDBC & TSM, but maybe someone knows differently?



Re: JDBC-ODBC Bridge and TSM ODBC driver

2002-05-10 Thread Warren, Matthew James

Ok,

After a little hunting I have managed to get it working using the 'empty'
MSAccess DB method containing links to the TSM DB, and pointing JDBC at that
intsead.

Has there been any progress getting it to work right off the bat with
JDBC-ODBC Bridge??

Thanks,

Matt.

-Original Message-
From: Warren, Matthew James [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 11:19 AM
To: [EMAIL PROTECTED]
Subject: JDBC-ODBC Bridge and TSM ODBC driver


He TSM'ers,

Has anyone any success connecting to the TSM database using the JDBC-ODBC
bridge and the TSM ODBC drivers? I have set bot system and user datasources
using the TSM ODBC driver, and I am then attmepting to access this from Java
using the JDBC-ODBC bridge.

Currently I am using this code in a Main method;

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException CNFE)
{
System.out.println(CNFE.toString());
}
try
{
Connection con =
DriverManager.getConnection("jdbc:odbc:SPADUX","{auserid}","{apassword}");
}
catch(SQLException SQLE)
{
System.out.println(SQLE.toString());
}


I have tried with both a System DSN setup called SPADUX using the TSM ODBC
drivers, and a user DSN.


And I get the following error;

Session established with server SPADUX0001: Solaris 7/8
  Server Version 4, Release 2, Level 1.9
  Server date/time: 05/10/2002 11:12:44  Last access: 05/10/2002 11:05:26

java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6138)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6266)
at sun.jdbc.odbc.JdbcOdbc.SQLColAttributes(JdbcOdbc.java:2044)
at
sun.jdbc.odbc.JdbcOdbcResultSet.getColAttribute(JdbcOdbcResultSet.java:5241)
at
sun.jdbc.odbc.JdbcOdbcResultSet.getColumnType(JdbcOdbcResultSet.java:5870)
at
sun.jdbc.odbc.JdbcOdbcResultSet.getMaxCharLen(JdbcOdbcResultSet.java:5269)
at
sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:267)
at
sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1473)
at
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:379)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:163)
at java.sql.DriverManager.getConnection(DriverManager.java:515)
at java.sql.DriverManager.getConnection(DriverManager.java:174)
at TSMBillMan.main(TSMBillMan.java:32)


If I use the Forte4J CE Database connection class wizard, I get the extra
information along with the above;

'Unable to Connect: TSM: There is no information about this table'

When the wizard attempts to connect to the DB. I guess the wizard is
attempting to query something similar to the syscat tables to discover
details about the database??


Has anyone else come across this, or succesfully used the JDBC-ODBC Bridge
and the TSM ODBC driver?