dcsimg
Moving thru resultset 1 record at a time
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sherbir_S
Posted On:   Thursday, March 25, 2004 08:10 AM

I have designed an interface in Java Swing in order to


access an MS-Access database records.





My problem is that how will I move forward or back thru the


database 1-record at a time by clicking my JButton named as


NEXT and PREVIOUS ?




Pls Help !!

Re: Moving thru resultset 1 record at a time

Posted By:   Alvaro_Ulate  
Posted On:   Thursday, March 25, 2004 08:39 AM

IF I understand your problem, you want walk through the resultset and display the selected row when you Click your Button,

create a javabean for the table register

javabean attributes = Table fields.


you can read every row in the resultset in javabean register and put it in a vector, After this just iterate the vector, store the index of selected row in Integer variable, and display the object selected by the index,

when you click your button next


index++;
Register= (RegisterBean) VectorName.get(index);



and in the JFrame

txtField1.setText(Register.getField1());
.
.
.
About | Sitemap | Contact