
I am using Java netbeans ide. Q 1.Every Time i execute a query My ResultSet points to zero. is there any mechanism to make my cursor point to the last row i viewed.or traveresd through..
Q 2.Whenever a new Record is created in a Database.A unique textfile is created on a host machine.But when i try to delete that file..It does show that the file is deleted but the file still remains there in a harddisk. Filepath is properly passed to the Deleting function but still can't delete it.
I have already spended 18 days to get this right but still can't Please help me..

Sql View last record
If you want to view the last record of database table, then use rs.last() method:
import java.sql.*;
class RetrieveData{
public static void main(String[] args){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from data");
if(rs.last()){
System.out.println(rs.getString("name")+" "+rs.getString("address"));
}
}
catch(Exception e){
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.