Posts

Showing posts from March, 2011

Java Code for implementation of Scrollable Resultset(movenext,moveprevious,movefirst,movelast)

import java.io.*; import java.sql.*; import java.awt.*; import java.awt.event.*; class slip2 extends Frame implements ActionListener { Button b1,b2,b3,b4; TextField t1,t2,t3,t4; Label l1,l2,l3,l4; Connection con=null; Statement st=null; ResultSet rs=null; slip2() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:emp1"); st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs=st.executeQuery("select * from emp"); } catch(Exception ee) { System.out.println("fsfsddsf"+ee); } l1=new Label("Enter No"); l2=new Label("Enter Name"); l3=new Label("Enter Salary"); t1=new TextField(); t2=new TextField(); t3=new TextField(); b1=new Button("First"); b2=new Button("Last"); b3=new Button("Next"); b4=new Button("Previous"); setLayout(null); add(l1); l1.setBou...