Hi experts,
I'm using Java 1.7
I'm using following code in my project
Connection pgConn = DBConnection.getPGSQLConnection();
statement = pgConn.createStatement();
resultSet = statement.executeQuery(selectQuery);
doc = xmlCnv.converToXML(resultSet);
What I need to do is ...
resultSet = statement.executeQuery(selectQuery);
while(resultSet .next()){
count += 1;
}
if(count>0 ){
doc = xmlCnv.converToXML(resultSet);
}
But in here after the resultSet iterate through the while loop, it becomes null.
What I want to do is ' doc = xmlCnv.converToXML(resultSet);' part execute , if there's a records in the resultSet.
Pls guide me how to overcome this issue
Thanks
Charith