Skip to Content.
Sympa Menu

freetds - Why ? I have "Exception- java.lang.NullPointerException".

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Yasuo Dan Itoh" <danitoh AT cresc.co.jp>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Why ? I have "Exception- java.lang.NullPointerException".
  • Date: Sat, 17 Feb 2001 01:09:37 -0500


Thank you Bob Kline,
I could get *.jar of FreeTDS driver for MSSQL7.0.

However my code told me "Exception- java.lang.NullPointerException".
I found same MESSAGE of this problem on this board. But I din't understand
yet.
Please let me know any more advice for this problem.
My JDK is JDK1.3. And some maker's jdbc is working same URL and Table
name.

Thank you, (Today is very beautiful day in Tokyo)
-------------------------------------------
Yasuo Itoh <danitoh AT cresc.co.jp>
office:Cresc Corporation <http://www.cresc.co.jp>
4-5-12-201 Shiba Minato-ku Tokyo Japan 108-0014
TEL/FAX 03-5484-7885
home: <danitoh AT cts.ne.jp>
<http://www1.cts.ne.jp/~danitoh>
-------------------------------------------
Exception- java.lang.NullPointerException
Exception in thread "main" 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)
at FreeTDS.main(FreeTDS.java:19)
-------------------------------------------
import java.sql.*;
import java.io.*;

public class FreeTDS {

static public void main(String args[])
throws SQLException
{

String username = "daiwa";
String password = "daiwa";
String thinConn
"jdbc:freetds:sqlserver://192.168.153.127/daiwa;tds=7.0";
String driverClass = "com.internetcds.jdbc.tds.Driver";

Connection cx =null;
try {
Class.forName(driverClass);
cx = DriverManager.getConnection(thinConn,username,password);
} catch(ClassNotFoundException e) {System.out.println("DB-Driver-class
not found");
} ////////catch(SQLException e)
{System.out.println("SQL-Exception:"+e.getMessage());
////////}

Statement statement = cx.createStatement();





Archive powered by MHonArc 2.6.24.

Top of Page