I have a problem when using JDBC and SQL to access my AS400 database. The problem happens when there is a period in the library name. Eg Library TRK1.5B
An extract of my java code is as follows:
// Register Native JDBC Driver and connect to local DB.
Connection c = DriverManager.getConnection("jdbc:db2:*local");
// Run an SQL query on the table.
Statement s = c.createStatement();
ResultSet rs = s.executeQuery("SELECT * FROM TRK1.5B.T2USERP ORDER BY SRUSER");
When this is run I get the following error message: java.sql.SQLException: Numeric constant .5B not valid.?
This is because there is a period in the library name and SQL doesn't like TRK1.5B.T2USERP
If I change the library name to another that has no period eg TRKTEST the java program works fine.
Any ideas apart from changing the library name on getting round this?
This E-Mail and any attachments maybe confidential and be the subject of legal professional privilege.
Any disclosure , use, storage or copying of this E-Mail without the consent of the sender is strictly prohibited.
Please notify the sender immediately if you are not the intended recipient and then delete the E-Mail from
your inbox and do not disclose the contents to another person ,use, copy or store the information in any medium.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.