hi all,i have a java project, i want to read records from a data base(access) and then put them in a container with check box within each record..but my code is only displaying the last record of the table..i want each record to be displayed on a line..please help me it's soo urgent :S ....my function's code is:
Statement Sa=null;
ResultSet RSa=null;
Connection connecti=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connecti=DriverManager.getConnection("jdbc:odbc:test1","","");
Sa=connecti.createStatement();
RSa=Sa.executeQuery("Select RoomType,Costperday From clientchoices");
content=getContentPane();
content.setBackground(Color.BLUE);
content.setForeground(Color.RED );
content.setLayout(null);
String out="";
JLabel t1=new JLabel();
t1.setBounds(20,20,200,200);
while(RSa.next()){
out=RSa.getString("RoomType")+"\t"+
RSa.getString("Costperday");
t1.setText(out);
content.add(t1);
}
setTitle("Personnel Information");
setSize(600,600);
setVisible(true);
JFrame.setDefaultLookAndFeelDecorated(true);
}
catch(Exception ee1){
System.out.println("Erreur " +ee1);
}
}
thnx in advance