Stored Procedure for implementing pagination
Transact-SQL
CREATE PROCEDURE dbo.pr__Get_Employees
@endindex Int,
@pagesize Int
AS
BEGIN
Create table #temp_cws(id numeric(5) identity, name varchar(100))
Insert into #temp_cws
Select name
From EMPLOYEE
Select e.name, e.* from #temp_cws t, EMPLOYEE e
WHERE (t.id > @endindex - @pagesize And t.id <= @endindex)
AND e.name = t.name
END
When I call this procedure from
Java program I am getting a null pointer exception at result set
// JAVA CODE SAMPLE
conn = DBConnection.getConnection();
cstmt = conn.prepareCall(sql);
cstmt.setInt(1, endIndex);
cstmt.setInt(2, pageSize);
boolean bresult = cstmt.execute();
rs = cstmt.getResultSet(); // Resultset giving null
while (rs.next()) { // Null pointer exception raised here
Please help
Thanks
Sreedhar Napa