package com;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Test {

    public static void main(String[] args) {

        Connection conn = null;
        Statement stmt = null;
        try {
            //    dbCheck.sh["oracle.jdbc.driver.OracleDriver","jdbc:oracle:thin:@10.250.190.148:1521:ORCL","JIRA603","JIRA603"]
            String driver = "oracle.jdbc.driver.OracleDriver";
            String url = "jdbc:oracle:thin:@10.250.190.148:1521:ORCL";
            String username = "JIRA603";
            String password = "JIRA603";
            //            String column = (String) map.get("column");
            //            if (column == null || column.trim().equals("")) {
            //                column = "1";
            //            }
            //            int c = Integer.parseInt(column);
            Class.forName(driver);
            conn = DriverManager.getConnection(url, username, password);
            //            stmt = conn.createStatement();
            //            String sql = (String) map.get("sql");
            //            ResultSet rs = stmt.executeQuery(sql);
            //            if (rs.next()) {
            //                return rs.getString(c);
            //            } else {
            //                return "0";
            //            }
            System.out.println("OK");
        } catch (SQLException se) {
            se.printStackTrace();
        } catch (Throwable se) {
            se.printStackTrace();
        } finally {
            if (stmt != null) {
                try {
                    stmt.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }

    }

}
