Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // daniel aka sKwa
- import java.sql.*;
- import java.util.Properties;
- public class Runtimecap {
- public static void main(String[] args) {
- try {
- Class.forName("com.vertica.jdbc.Driver");
- } catch (ClassNotFoundException e) {
- System.err.println("Could not find the JDBC driver class.");
- e.printStackTrace();
- return;
- }
- Properties myProp = new Properties();
- myProp.put("user", "daniel");
- myProp.put("password", "a");
- myProp.put("ConnSettings", "SET SESSION RUNTIMECAP '10 minutes'");
- Connection conn;
- try {
- String conn_str = "jdbc:vertica://localhost:5433/sampler";
- conn = DriverManager.getConnection( conn_str, myProp);
- Statement stmt = conn.createStatement();
- ResultSet rs = null;
- rs = stmt.executeQuery("SHOW RUNTIMECAP");
- System.out.print("Query reports that RUNTIMECAP is set to: ");
- while (rs.next()) {
- System.out.println(rs.getString(2).trim());
- }
- conn.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement