Skip to Content.
Sympa Menu

freetds - Re: NullPointerException using JDK 1.3

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stefan Bodewig <bodewig AT bost.de>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: NullPointerException using JDK 1.3
  • Date: 18 May 2000 13:44:56 +0200

>>>>> "JS" == Justin Schwartz <justin AT wfw.co.za> writes:

JS> For some reason, when I tried to establish a connection to an
JS> MSSQL database using the freetds JDBC driver under the JDK1.3 VM
JS> it causes a NullPointerException in the Constructor.

The problem is that Constructors.java doesn't recognize JDK 1.3 at
all. There have been reports on this before, but somehow the patch to
change this didn't get into the CVS repository.

Please try the appended patch and see whether it works for you

Stefan

--- Constructors.java	Tue Jan 25 18:33:52 2000
+++ /home/bodewig/Constructors.java	Thu May 18 13:43:32 2000
@@ -110,19 +110,19 @@
          };
          
          
-         if (java.lang.System.getProperty("java.version").startsWith("1.1"))
-         {
-            jdbcVersion     = JDBC1_0;
-            jdbcVersionName = "1_0";
-         }
-         else if (java.lang.System.getProperty("java.version").startsWith("1.2"))
-         {
+         jdbcVersion     = JDBC1_0;
+         jdbcVersionName = "1_0";
+         try {
+            // executeBatch is new in JDBC 2.0
+            Class statement = java.lang.Class.forName("java.sql.Statement");
+            java.lang.reflect.Method execBatch = 
+                statement.getDeclaredMethod("executeBatch", new Class[0]);
+
             jdbcVersion     = JDBC2_0;
             jdbcVersionName = "2_0";
-         }
-         else
+         } 
+         catch (NoSuchMethodException nsme) 
          {
-            // XXX What do we have here?  Should we throw an exception?
          }
          
 



Archive powered by MHonArc 2.6.24.

Top of Page