×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I think that under the circumstances, I've already been asking more than
too much of Mr. Klement, and so if somebody else can coach me on this,
please do.
Which is to say that Sctt, you need to concentrate on healing.
But as to the matter where I need help: it appears that I'm going to
have to do some things that involve non-trivial extensions to JDBCR4.
Case in point, to find out what a file's primary keys are, through a
JDBC connection, it seems I need to do something like:
conn = DriverManager.getConnection(DB_URL,USER,PASS);
DatabaseMetaData dmd = conn.getMetaData();
ResultSet mdrs = dmd.getPrimaryKeys(null, "EMP", "Employees");
while (mdrs.next()) {
System.out.println("column name: /" + mdrs.getString("COLUMN_NAME")
+ "/ KEY_SEQ: /"+ mdrs.getString("KEY_SEQ")
> + "/ PK_NAME: /" + mdrs.getString("PK_NAME") + "/");
};
(assuming we're looking at a table called "Employees," in a schema
called "EMP," from the TutorialsPoint JDBC tutorial). This Java code
works fine for both DB2/400 and MySQL. MySql produces:
column name: /id/ KEY_SEQ: /1/ PK_NAME: /PRIMARY/
while DB2/400 produces:
column name: /ID/ KEY_SEQ: /1/ PK_NAME: /Q_EMP_EMPLOYEES_ID_00001/
The problem is that JDBCR4 doesn't appear to have any front-end for the
DatabaseMetaData class, let alone the Connection.getMetaData() and
DatabaseMetaData.getPrimaryKeys(<catalog>, <schema>, <table>) methods.
While I managed to successfully front-end the GetColLabel(<index>),
getPrecision(<index>), and getScale(<index>) methods, those appear to be
Tinkertoys compared with front-ending DatabaseMetaData.
Can anybody help?
--
JHHL
As an Amazon Associate we earn from qualifying purchases.