code: public void addPrimaryKey (Connection conn, String table, List<String> columns)
          throws SQLException
      {
          StringBuilder fields = new StringBuilder("(");
          appendColumns(columns, fields);
          fields.append(")");
          String update = "ALTER TABLE " + tableSQL(table) + " ADD PRIMARY KEY " + fields.toString();
  
          executeQuery(conn, update);
          log("Primary key " + fields + " added to table '" + table + "'");
      }
docs: from DatabaseLiaison