Hello,

I have a procedure in SQL SERVER which as the following signature
ALTER PROCEDURE
pr_LeaveBalance
(@EmpID varchar(50),
@LType varchar(10),
@FDate datetime,
@EDate datetime,
@ELocation varchar(50) ,
@Balance float OUTPUT,
@AppliedDays float OUTPUT,
@LopDays float OUTPUT,
@LopStartDate datetime OUTPUT,
@Result varchar(50) OUTPUT)
......

Here is the jdbc code used to execute the procedure.

......
...
CallableStatement statement=trans.getCallableStatement("{call dbo.pr_LeaveBalance(?,?,? ,?,?,?,?,?,?,?)}");

statement.setFloat(6,0);
statement.setFloat(7,0);
statement.setFloat(8,0);
statement.setTimestamp(9,null);
statement.setString(10,"");

statement.registerOutParameter(6,java.sql.Types.FL OAT);
statement.registerOutParameter(7,java.sql.Types.FL OAT);
statement.registerOutParameter(8,java.sql.Types.FL OAT);
statement.registerOutParameter(9,java.sql.Types.TI MESTAMP);
statement.registerOutParameter(10,java.sql.Types.V ARCHAR);

HttpSession session = request.getSession(true);
//aveHomeBean empDtl =(LeaveHomeBean)session.getAttribute("emp");

//statement.setString(1,empDtl.getEmpID());
statement.setString(1,"VM885");
//statement.setString(2,((HandleLeaveForm)form).getL eaveType());
statement.setString(2,"10");

//String FromDate = ((HandleLeaveForm)form).getFromDate();
String FromDate="21-01-2004";
FromDate.trim();
StringTokenizer st = new StringTokenizer(FromDate,"-");
while(st.hasMoreTokens()){
Date=Integer.parseInt(st.nextToken());
Month=Integer.parseInt(st.nextToken())-1;
Year =Integer.parseInt(st.nextToken());
}

java.sql.Date FromDt=new Date(Year,Month,Date);

//String ToDate = ((HandleLeaveForm)form).getToDate();
String ToDate="27-01-2004";

ToDate.trim();
st = new StringTokenizer(ToDate,"-");
while(st.hasMoreTokens()){
Date=Integer.parseInt(st.nextToken());
Month=Integer.parseInt(st.nextToken())-1;
Year =Integer.parseInt(st.nextToken());
}
java.sql.Date ToDt=new Date(Year,Month,Date);

statement.setDate(3,FromDt);
statement.setDate(4,ToDt);


//statement.setString(5,empDtl.getEmpLocation());
statement.setString(5,"L001");

ResultSet rs =statement.executeQuery();

System.out.println("aFTER");

//System.out.println("Balance is="+statement.getFloat(6));
//System.out.println("Days Applied is="+statement.getFloat(7));
//System.out.println("Leave Without pay is ="+statement.getFloat(8));

//Sytem.out.println("Lop startDate is="+statement.getTimestamp(9));
//Sytem.out.println("Result is="+statement.getString(10));

}catch(Exception e){
e.printStackTrace();
}

And I get the error
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The
conversion from datetime data type to smalldatetime data type resulted in a smalldatetime overflow error.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Source
)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
Source)