Skip to Content.
Sympa Menu

freetds - FreeTDS_JDBC's supportability on Stored Procedures

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Weiqun Zhu" <weiqun_zhu AT rapidcommunications.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: FreeTDS_JDBC's supportability on Stored Procedures
  • Date: Thu, 5 Jul 2001 10:54:49 -0400


1. Information:
(1)We are using the latest freetds_jdbc_snapshot.jar dated 03/08/2001.
(2)The version of the TDS protocol: not specified, therefore defaults to
TDS 4.2.
(3)The version of the JVM: 1.3.1
(4)DBMS: SQL Server 7.0, Platform: WinNT(4.0) Server.
(5)Client machine: Win2000. Web Server: tomcat 3.2.
(6)The problem is present with the latest snapshot since it is the one we
are using.
(7)No other layers.

2. Details of the problem:
I'm having problems while using a Stored Procedure we created:

Below is a piece of code:
public boolean populateUserInfo() {
boolean allOK = false;

JSPConnectionPool connectionPool = null;
Connection connection = null;
CallableStatement cs = null;
int errorCode = 1;

try{
connectionPool = JSPConnectionPool.getPool();
connection = connectionPool.getConnection();
/*
@userName varchar(50),
@passWord varchar(50),
@ERROR_CODE int,
@USERID int,
@userFirstName varchar(50),
@userMiddleInitial varchar(50),
@userLastName varchar(50),
@userAddress1 varchar(50),
@userAddress2 varchar(50),
@userCity varchar(50),
@userStateCode int,
@userZip varchar(50),
@userCountry varchar(50),
@userEmail varchar(50),
@userTypeCode varchar(50),
@userStartPage varchar(50)
*/
System.out.println("four");
cs = connection.prepareCall("{call
validateUserGetUserInfo(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
cs.setString(1, username);
System.out.println("onea");
cs.setString(2, password);
System.out.println("oneb");
cs.registerOutParameter(3,
java.sql.Types.OTHER);//java.sql.Types.INTEGER);
System.out.println("onec");

cs.registerOutParameter(4, java.sql.Types.INTEGER);
cs.registerOutParameter(5, java.sql.Types.VARCHAR);
System.out.println("oned");
cs.registerOutParameter(6, java.sql.Types.VARCHAR);
cs.registerOutParameter(7, java.sql.Types.VARCHAR);
cs.registerOutParameter(8, java.sql.Types.VARCHAR);
cs.registerOutParameter(9, java.sql.Types.VARCHAR);
cs.registerOutParameter(10, java.sql.Types.VARCHAR);
cs.registerOutParameter(11, java.sql.Types.INTEGER);
cs.registerOutParameter(12, java.sql.Types.VARCHAR);
cs.registerOutParameter(13, java.sql.Types.VARCHAR);
cs.registerOutParameter(14, java.sql.Types.VARCHAR);
cs.registerOutParameter(15, java.sql.Types.INTEGER);
cs.registerOutParameter(16, java.sql.Types.VARCHAR);
System.out.println("five");
cs.execute();
System.out.println("six");
//check the errorCode as that is what we base allOK on
//don't need to change to false as that is the default
errorCode = cs.getInt(3);
if(errorCode == 0)

The problems with the code is the outparameters. The drive will not allow
us to register them. The registerOutParameter is failing.


Does anyone see this problem before? Any help is greatly appreciated.


Weiqun




Archive powered by MHonArc 2.6.24.

Top of Page