Skip to Content.
Sympa Menu

freetds - calling sp_password store procedure failed

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Son To" <Son.To.wh98 AT wharton.upenn.edu>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: calling sp_password store procedure failed
  • Date: Fri, 27 Jul 2001 16:15:30 -0400


I am tring to call the sp_password store procedure in MS-SQL to change the
user's password, but am getting a NULL pointer exception:

Here is the code
---
import java.sql.*;

public class StoreProcedure
{
public static void main(String[] argv) throws Exception
{

Class.forName("com.internetcds.jdbc.tds.Driver");
//Class.forName("com.ashna.jturbo.driver.Driver");

String url = "jdbc:freetds:sqlserver://ceres/pubs";
//String url = "jdbc:JTurbo://ceres/pubs/sql70=true";
Connection con = DriverManager.getConnection(url,"sa","ces");

CallableStatement cs = con.prepareCall("{call sp_password(???)}");
cs.setString(1,"son"); //old passwrod
cs.setString(2, "foobar"); //new password
cs.setString(3,"son"); //user
System.out.println(cs.executeUpdate());


}
}
--
Here is the Exception:

$ java StoreProcedure
Exception in thread "main" java.lang.NullPointerException
at com.internetcds.jdbc.tds.Tds.executeProcedure(Tds.java:2595)
at
com.internetcds.jdbc.tds.PreparedStatement_base.executeCall(PreparedS
tatement_base.java:199)
at
com.internetcds.jdbc.tds.CallableStatement_base.execute(CallableState
ment_base.java:394)
at
com.internetcds.jdbc.tds.PreparedStatement_base.executeUpdate(Prepare
dStatement_base.java:346)
at StoreProcedure.main(StoreProcedure.java:19)

I am using the latest release at
ftp://freetds.internetcds.com/pub/freetds_jdbc/freetds_jdbc.snapshot.jar
Using jdk1.3.1 on windows 2000
Any ideas?




Archive powered by MHonArc 2.6.24.

Top of Page