Skip to Content.
Sympa Menu

freetds - Re: Trying to get started

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Trying to get started
  • Date: Mon, 19 Jun 2000 13:11:34 -0400 (EDT)


You might try adding e.getTargetException().printStackTrace(); to the
catch for the InvocationTargetExecption, and e.printStackTrace() to the
catch for the Throwable and see where that leads you. The repackaging
of the exception is masking where the problem is happening.

Bob

On Mon, 19 Jun 2000, Mark MacRae wrote:

> Bob,
> Thanks for the suggestion; however I'm still getting the same Exception. I
> actually just added another else if to the section of Constructors.java to
> check for Java 1.3.
>
> I've tried connecting using both the server name and it's IP (which I had to
> use to connect to Oracle).
>
>
> -----Original Message-----
> From: Bob Kline [mailto:bkline AT rksystems.com]
> Sent: Friday, June 16, 2000 8:14 PM
> To: TDS Development Group
> Subject: [freetds] Re: Trying to get started
>
>
> On Fri, 16 Jun 2000, Mark MacRae wrote:
>
> > Please excuse the simple question, but can't even get connected to my
> > SQLServer. Included below is a snippit of the exception(s) I get:
> >
> > Exception- java.lang.NullPointerException
> > Exception- java.lang.NullPointerException
> > java.sql.SQLException at
> > com.internetcds.jdbc.tds.Constructors.newConnection(Constructors.java:305)
> > at com.internetcds.jdbc.tds.Driver.connect(Driver.java:257)
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:517)
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:177)
> >
> > I compiled the 2.0 version under JDK 1.3. I'm using the following type
> line
> > to get connected:
> >
> > Connection conn =
> > DriverManager.getConnection("jdbc:freetds:sqlserver://server/database",
> > "user", "password");
> >
>
> Try making a change to Constructors.java. Find the line which compares
> the return from java.lang.System.getProperty("java.version") with
> "1.2" and sets jdbcVersion to JDBC2_0 if it matches. Change that line
> to also look for "1.3" at the beginning of the Java version string.
>
> Here's another (more robust) approach (credit to Stefan Bodewig):
>
> try
> {
> 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";
> }
> catch (NoSuchMethodException nsme)
> {
> jdbcVersion = JDBC1_0;
> jdbcVersionName = "1_0";
> }
>
>

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com





Archive powered by MHonArc 2.6.24.

Top of Page