|
Colin Williams wrote: > Is this a local connection to the database, or is this from > another system, > as I don't think that local connections need a userid or password, > they can use the current user profile to connect? Colin, thanks for your suggestions. Sorry it has taken me so long to get back to this. This is, indeed, a local connection, though the application is designed to run on multiple platforms, so I don't want to introduce too much iSeries-specific stuff. > con = > DriverManager.getConnection("jdbc:db2:*local", > properties); I can get this to work, as I can the jdbc:db2://localhost form of the URL, and indeed, the version I'm accustomed which specifies the name of the SQL collection (= library) on the URL, like this: jdbc:db2://localhost/library-name. All well and good. However, it seems to me that I ought to be able to do the same thing when using the toolbox driver with native optimisations. So using a URL like jdbc:as400://localhost/library-name, after loading com.ibm.as400.access.AS400JDBCDriver, should work. However, instead I get an SQLException saying "Password is *NONE" (see stack trace below). Now, we can tell our clients that they should use the native driver; but I think that both drivers ought to behave in the same way here, and that the native driver is doing the correct thing. Others may disagree, of course. I would be particularly interested to hear from the Toolbox developers who sometimes post here; or anyone who has any ideas about how to get round this, of course. Note also that I get the same results when I call DriverManager.getConnection(url) as when I call DriverManager.getConnection(url, user, password) with null values for user and password, or with "*CURRENT" for user and password. Here's the stack trace when I use the Toolbox driver with native optimisations: java.sql.SQLException: The application server rejected the connection.(Password is *NONE.) java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:85) java/lang/Exception.<init>(Ljava/lang/String;)V+1 (Exception.java:33) java/sql/SQLException.<init>(Ljava/lang/String;Ljava/lang/String;I)V+1 (SQLException.java:34) com/ibm/as400/access/JDError.throwSQLException(Ljava/lang/String;Ljava/lang/ Exception;)V+66 (JDError.java:480) com/ibm/as400/access/AS400JDBCConnection.setProperties(Lcom/ibm/as400/access /JDDataSourceURL;Lcom/ibm/as400/access/JDProperties;Lcom/ibm/as400/access/AS 400;)V+10 (AS400JDBCConnection.java:2738) com/ibm/as400/access/AS400JDBCDriver.prepareConnection(Lcom/ibm/as400/access /AS400;Lcom/ibm/as400/access/JDDataSourceURL;Ljava/util/Properties;Lcom/ibm/ as400/access/JDProperties;)Ljava/sql/Connection;+56 (AS400JDBCDriver.java:807) com/ibm/as400/access/AS400JDBCDriver.initializeConnection(Lcom/ibm/as400/acc ess/JDDataSourceURL;Lcom/ibm/as400/access/JDProperties;Ljava/util/Properties ;)Ljava/sql/Connection;+365 (AS400JDBCDriver.java:698) com/ibm/as400/access/AS400JDBCDriver.connect(Ljava/lang/String;Ljava/util/Pr operties;)Ljava/sql/Connection;+82 (AS400JDBCDriver.java:285) java/sql/DriverManager.getConnection(Ljava/lang/String;Ljava/util/Properties ;Ljava/lang/ClassLoader;)Ljava/sql/Connection;+144 (DriverManager.java:512) java/sql/DriverManager.getConnection(Ljava/lang/String;Ljava/lang/String;Lja va/lang/String;)Ljava/sql/Connection;+37 (DriverManager.java:172) Cheers, Martin. -- Martin McCallion Senior Technical Consultant Misys Wholesale Banking Systems 1 St George's Road, London, SW19 4DR, UK T +44 (0)20 8486 1951 F +44 (0) 20 8947 3373 martin.mccallion@xxxxxxxxx www.misys.com This email and any attachments have been scanned for known viruses using multiple scanners. We believe that this email and any attachments are virus free, however the recipient must take full responsibility for virus checking. This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the intended named recipient of this email then you should not copy it or use it for any purpose, nor disclose its contents to any other person. You should contact the Misys Banking and Securities Division as shown below so that we can take appropriate action at no cost to yourself. Misys Banking and Securities Division, 1 St George's Road, Wimbledon, London, SW19 4DR, England. Email: banking.postmaster@xxxxxxxxxx Tel: +44 (0) 20 8879 1188 Fax: +44 (0) 20 8947 3373
As an Amazon Associate we earn from qualifying purchases.
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.