The Complete Project Source Code Platform

Kashipara.com is a community of ONE million programmers and students, Just like you, Helping each other.Join them. It only takes a minute: Sign Up

Job Resume Template

how can display questions on next and previous button clicking in java swing

  divya_kamboj    2016-04-20 09:33:57

0

0


if(ae.getSource()==next)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; String scode=tcode.getText();<br>&nbsp;&nbsp;&nbsp; &nbsp;try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; Connection con=DriverManager.getConnection("jdbc:odbc:online");<br>&nbsp;&nbsp;&nbsp; Statement s=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);<br>&nbsp;&nbsp;&nbsp; PreparedStatement ps=con.prepareStatement("select * from adqus where Test_Name='"+scode+"' "); <br>&nbsp;&nbsp;&nbsp; ResultSet rs = ps.executeQuery();<br><br>&nbsp;&nbsp;&nbsp; while(rs.next())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; System.out.println("test");<br>&nbsp;&nbsp;&nbsp; for(i=1;i&lt;=1;i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; qusno.setText(rs.getString(3));<br>&nbsp;&nbsp;&nbsp; tqus.setText(rs.getString(4));<br>&nbsp;&nbsp;&nbsp; topa.setText(rs.getString(5));<br>&nbsp;&nbsp;&nbsp; topb.setText(rs.getString(6));<br>&nbsp;&nbsp;&nbsp; topc.setText(rs.getString(7));<br>&nbsp;&nbsp;&nbsp; topd.setText(rs.getString(8));<br>&nbsp;&nbsp;&nbsp; &nbsp;i++;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; catch(Exception ex)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; System.out.println(ex);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>if(ae.getSource()==previous)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; String scode=tcode.getText();<br>&nbsp;&nbsp;&nbsp; try<br>{ <br>&nbsp;&nbsp;&nbsp; Connection con=DriverManager.getConnection("jdbc:odbc:online");<br>&nbsp;&nbsp;&nbsp; Statement s=con.createStatement();<br>&nbsp;&nbsp;&nbsp; PreparedStatement ps=con.prepareStatement("select * from adqus where Test_Name='"+scode+"'"); <br>&nbsp;&nbsp;&nbsp; ResultSet rs = ps.executeQuery();<br>&nbsp;&nbsp;&nbsp; while(rs.next())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; System.out.println("test");<br>&nbsp;&nbsp;&nbsp; for(i=0;i&lt;1;i--)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; qusno.setText(rs.getString(3));<br>&nbsp;&nbsp;&nbsp; tqus.setText(rs.getString(4));<br>&nbsp;&nbsp;&nbsp; topa.setText(rs.getString(5));<br>&nbsp;&nbsp;&nbsp; topb.setText(rs.getString(6));<br>&nbsp;&nbsp;&nbsp; topc.setText(rs.getString(7));<br>&nbsp;&nbsp;&nbsp; topd.setText(rs.getString(8));<br>&nbsp;&nbsp;&nbsp; &nbsp;i--;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; catch(Exception ex)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; System.out.println(ex);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>

Answers

Post Your answer