JDBC connection to NLS database fails
Posted in 1999
When running the TableExample2 that comes with the JDK 1.2 I get the following error: C:\\>java TableExample2 Opening db connection Cannot connect to this database. java.sql.SQLException: DBNLS is not set or LC_COLLATE must be 'en_US'. Configuration: - Informix Online Server 7.13UC2 on Solaris 2.51 - db that I'm trying to connect to has NLS Capabilities and Attributes en_US Collating Sequence, en_US CType - db URL: jdbc:informix-sqli://myhostname:1526/mydbname:informixserver=myinformixserve r;user=myusername;password=mypassword - Informix JDBC Driver 1.40.JC2 - Client: Windows NT 4.0 SP4, German with JDK1.2 No difference when I add ;DBNLS=2;LC_COLLATE=en_US (our normal setnet32 settings) to the end of the db URL. These two environment variables are not listed as "supported environment variables" in the Informix JDBC driver documentation. Connecting to a non NLS db works fine. Any ideas out there? How can I supply values for DBNLS and LC_COLLATE to the driver if not through the user's environment or supplying them with the db URL or a Java Properties Class? Any help would be greatly appreciated. Thanks and Cheers E.