示例#1
0
  @Override
  public String createTable(
      String connectionToken,
      int schema,
      String tableName,
      boolean unlogged,
      boolean temporary,
      String fill,
      ArrayList<String> col_list,
      HashMap<Integer, String> commentLog,
      ArrayList<String> col_index)
      throws DatabaseConnectionException, PostgreSQLException {

    ConnectionManager connMgr = new ConnectionManager();
    HttpServletRequest request = this.getThreadLocalRequest();

    String clientIP = ConnectionInfo.remoteAddr(request);
    String userAgent = request.getHeader("User-Agent");

    Tables tables = new Tables(connMgr.getConnection(connectionToken, clientIP, userAgent));

    try {
      return tables.create(
          schema,
          q.addQuote(tableName),
          unlogged,
          temporary,
          fill,
          col_list,
          commentLog,
          col_index);
    } catch (SQLException e) {
      throw new PostgreSQLException(e.getMessage());
    }
  }