i found error in the following code....
import java.sql.*;
import java.util.*;
class search
{
public static void main(String args[])
throws Exception
{
Connection con=null;
ResultSet rs=null;
Statement st=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:oracle","user","vinay");
String s="select *from student where roll=?";
st=con.prepareStatement(s);
rs=st.executeQuery();
Scanner inp=new Scanner(System.in);
System.out.println("Enter roll to search");
int r=inp.nextInt();
st.setInt(1,r);
while (rs.next())
{
System.out.println("roll"+"name"+"address");
System.out.print(rs.getInt(1));
System.out.print(rs.getString(2));
System.out.print(rs.getString(3));
System.out.println();
}
con.close();
}
}