Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Properties prop = new Properties();
- FileInputStream propFile = new FileInputStream("C:/Users/leanovia/workspace-jboss/fatec/src/my.properties");
- prop.load(propFile);
- String myRequest = prop.getProperty("my.request");
- System.out.println(myRequest);
- try{
- Class.forName("oracle.jdbc.OracleDriver");
- Connection myConnection = DriverManager.getConnection("jdbc:oracle:thin:@//10.192.69.2:1521/TSTLEASE.PROD", "autoself", "autoself");
- Statement mySatement = myConnection.createStatement();
- System.out.println("Timeout: " + mySatement.getQueryTimeout());
- ResultSet myResult = mySatement.executeQuery(myRequest);
- while(myResult.next()){
- System.out.print("===== : ");
- System.out.println(myResult.getString(1));
- }
- }catch (Exception e){
- e.printStackTrace(System.out);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement