× 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.


  • Subject: Problem using SQL where library contains a period
  • From: Lee Bircham <lee.bircham@xxxxxxxx>
  • Date: Fri, 12 Jan 2001 12:26:57 -0000

Title: Problem using SQL where library contains a period

Hi,

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.
Class.forName("com.ibm.db2.jdbc.app.DB2Driver");
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?

Thanks,
Lee.


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.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.