public static void main(String args[]){
String driver = "oracle.jdbc.driver.OracleDriver";
String strUrl = "jdbc:oracle:thin:@192.168.1.1:1521:oracle";
try{
Class.forName(driver);
Connection conn = DriverManager.getConnection(strUrl, "zzh", "zzh");
System.out.println("Now Begin to excute......");
ResultSet rs = null;
Statement stmt = null;
String sql = "select BANKBRANCHCODE from BANKINTERFACE_DETAIL";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString(1));
}
}catch(Exception ex){
System.out.println(ex.getMessage());
}
}
String driver = "oracle.jdbc.driver.OracleDriver";
String strUrl = "jdbc:oracle:thin:@192.168.1.1:1521:oracle";
try{
Class.forName(driver);
Connection conn = DriverManager.getConnection(strUrl, "zzh", "zzh");
System.out.println("Now Begin to excute......");
ResultSet rs = null;
Statement stmt = null;
String sql = "select BANKBRANCHCODE from BANKINTERFACE_DETAIL";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString(1));
}
}catch(Exception ex){
System.out.println(ex.getMessage());
}
}