Here you can find the source of escapeReservedWord(String input)
static String escapeReservedWord(String input)
//package com.java2s; /*/*from w w w. j ava 2 s . c o m*/ * Copyright (c) 2016, Bui Nguyen Thang, thang.buinguyen@gmail.com, thangbui.net. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 */ import java.util.Arrays; import java.util.List; public class Main { private final static List<String> RESERVED_KEYWORDS = Arrays.asList("ADD", "ALLOW", "ALTER", "AND", "ANY", "APPLY", "ASC", "AUTHORIZE", "BATCH", "BEGIN", "BY", "COLUMNFAMILY", "CREATE", "DELETE", "DESC", "DROP", "EACH_QUORUM", "FROM", "GRANT", "IN", "INDEX", "INET", "INSERT", "INTO", "KEYSPACE", "KEYSPACES", "LIMIT", "LOCAL_ONE", "LOCAL_QUORUM", "MODIFY", "NORECURSIVE", "OF", "ON", "ONE", "ORDER", "PASSWORD", "PRIMARY", "QUORUM", "RENAME", "REVOKE", "SCHEMA", "SELECT", "SET", "TABLE", "TO", "TOKEN", "THREE", "TRUNCATE", "TWO", "UNLOGGED", "UPDATE", "USE", "USING", "WHERE", "WITH"); static String escapeReservedWord(String input) { return RESERVED_KEYWORDS.contains(input) ? "\"" + input + "\"" : input; } }