Ok, so I've successfully set up a MySQL server on a box with a fixed
internal IP address, and I can definitely reach it from both my Mac and
my V6 box.
And I can get the database metadata, because when it gets to this block
of code
Row1 = 'Driver Version = "' + DBMD_GetDriverVersion(dbmd) +
'" Product Name = "' + DBMD_GetDatabaseProductName(dbmd) + '"';
except;
it spits out
Driver Version = "mysql-connector-java-5.1.22 ( Re" Product Name = "MySQL"
But then, the next thing it tries to do is:
rs = JDBC_GetPrimaryKeys(dbmd: '*NULL': 'emp': 'Employees');
which gets processed in the service program thusly (to turn '*NULL' into
a Java null, and any other RPG string into a Java String):
jdbc_begin_object_group(50);
if (catalog = '*NULL');
cat = *NULL;
else;
cat = s(catalog);
endif;
if (schema = '*NULL');
sch = *NULL;
else;
sch = s(schema);
endif;
monitor;
temp = getPrimaryKeys(dbmd: cat: sch: s(table));
jdbc_end_object_group(temp: rs);
on-error;
jdbc_end_object_group();
return *NULL;
endmon;
return rs;
which works just fine connecting to DB2/400 on the same box (carrying
coals to Newcastle . . . ), and the corresponding Java statement:
ResultSet mdrs = dmd.getPrimaryKeys(null, "EMP", "Employees");
works just fine on DB2/400 and both a local MySQL server and the test
MySQL server, but when the RPG call gets to the "temp = getPrimaryKeys"
in the service program, something trips the monitor, returning a null
result set, I get a Java error message of
Incorrect database name ''" when calling method "getPrimaryKeys"
in the joblog, and ultimately, I end up with four(!) pairs of QPDSPJOB
and QPSRVDMP spool files, and no idea what the JVM could be objecting to.
The '*NULL' is correctly being turned into a Java null, and it's
definitely getting the correct schema and table names. And the Java
version works with the schema in either all-uppercase or all-lowercase.
I just don't get it.
--
JHHL