Java List Create createPrimaryKeysQuery(String tableName, List primaryKeys)

Here you can find the source of createPrimaryKeysQuery(String tableName, List primaryKeys)

Description

create Primary Keys Query

License

LGPL

Declaration

public static String createPrimaryKeysQuery(String tableName, List<String> primaryKeys) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.List;

public class Main {
    public static String createPrimaryKeysQuery(String tableName, List<String> primaryKeys) {
        StringBuilder query = new StringBuilder("ALTER TABLE ");
        query.append(tableName);//from w w  w.ja  v  a 2  s  .  c  o m
        query.append(" ADD PRIMARY KEY (");
        for (String key : primaryKeys) {
            query.append(key);
            query.append(",");
        }
        query.setLength(query.length() - 1);
        query.append(")");

        return query.toString();
    }
}

Related

  1. createOrgAttributeList()
  2. createOrGrow(List list, int minCapacity)
  3. createOutputTuple(List> tuples)
  4. createPostBody(final List required)
  5. createPrimaryKeyList(String primaryKeyStr)
  6. createQueryLogMessage(String query, List parameterValues)
  7. createQueryString(String query, List params)
  8. createRegion(String string, List regionList, int startIndex, int endIndex)
  9. createReleasesString(List tagsList)

  10. HOME | Copyright © www.java2s.com 2016