Connection con = null;
PreparedStatement statement = null;
ResultSet set = null;
try {
Class.forName("oracle.jdbc.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL","System","a5121921");
String sql = "select * from Custom where C_Id =?";
statement = con.prepareStatement(sql);
statement.setInt(1, 1);
set = statement.executeQuery();
}catch(Exception e){
e.printStackTrace();
}finally {
try {
con.close();
statement.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}