hi ,
i am always getting the error like
[Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position.
What could be the problem?
here is my code. i tried my level best. i couldn't bear with thie error
public dash[] getContentBatches() throws VRContentDashBoardException
{
DBOperation dbConn = null;
dash batches[] = null;
int count = 0;
Connection c = null;
ResultSet rs = null;
ResultSet r = null;
Statement stmt = null;
Statement s = null;
String sqlStmt = "SELECT * FROM ContentBatches WHERE status <> 'RETIRED' ORDER BY BATCHID DESC" ;
PreparedStatement ps = null;
System.out.println("Entering getContentDashBoard()");
try
{
dbConn = new DBOperation();
c = dbConn.getDatabaseConnection();
if (c != null)
{
s = c.createStatement();
r = s.executeQuery("SELECT COUNT(*) FROM CONTENTBATCHES");
if(r.next())
{
count = r.getInt(1);
System.out.println("count - ContentBatchesOperation:"+count);
}
if(count != 0)
{
batches = new dash[count];
stmt = c.createStatement();
rs = stmt.executeQuery(sqlStmt);
rs.next();
for(int i=0; i<count; i++,rs.next())
{
batches[i] = new dash();
batches.setContentProvider(rs.getString("ContentProvider"));
batches[i].setBatchId(rs.getString("BatchID"));
}
}
else
{
System.out.println("No data available in the data base - ContentBatchesOperation");
}
}
else
{
System.out.println("*** Connection object is null ***");
}
}
catch(SQLException es)
{
System.out.println("**** SQLException Error Code: " + es.getErrorCode());
System.out.println("**** SQLException Error Message: " + es.getMessage());
}