Hi,
I wanna use this vector as DataSource for my Jtable.There is 4 Column here (ADI,SOYADI,BABA ADI, ANA ADI). ResultSet is adding every row to vector named _kisivector.This is my DataSource.But i dont wanna get whole records at start.I wanna get only 5 records from this vector.Than there will be 2 button , back and forward.When i click Forward it will go for other 5 record.And when i click back button , it will go for 5 previous record.
Is there any example for this ?
Thanx.
private Vector getSonuc(String _ad){
Vector _kisivektor = new Vector();
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xx.xx.xx.xx.:1521:xxxx", "xxx", "xxx");
stmt = conn.prepareStatement("select * from t_gnl_kisi where ADI like ?");
stmt.setString(1, _ad+"%");
rs = stmt.executeQuery();
while (rs.next()) {
_kisivektor.add(rs.getString("ADI"));
_kisivektor.add(rs.getString("SOYADI"));
_kisivektor.add(rs.getString("ANA_ADI"));
_kisivektor.add(rs.getString("BABA_ADI"));
}
stmt.close();
rs.close();
}
catch (Exception e) {
e.printStackTrace();
}
return _kisivektor;
}
}