public String getSchema() throws SQLException {
    if (isClosed) {
      throw new SQLException("Connection is closed");
    }
    try (Statement stmt = createStatement();
         ResultSet res = stmt.executeQuery("SELECT current_database()")) {
      if (!res.next()) {
        throw new SQLException("Failed to get schema information");
      }
      return res.getString(1);
    }
  }
Creates a Statement object for sending SQL statements to the database.

@throws SQLException
          if a database access error occurs.
@see java.sql.Connection#createStatement()
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java