sqlhelper.java

来自「Athena酒店小组_Athena酒店管理系统」· Java 代码 · 共 57 行

JAVA
57
字号
/*
 * SQLHelper.java
 *
 * Created on 2007年5月25日, 上午12:07
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package helper;

import java.util.*;

/**
 *
 * @author Virlene Cheng
 */
public class SQLHelper
{
    
    /** Creates a new instance of SQLHelper */
    public SQLHelper()
    {
    }
    
    public static String createCondition(ArrayList<String> names)
    {	
	if (names == null)
	{
	    return "";
	}
	
	if (names.size() == 0)
	{
	    return "";
	}
	
	String condition = " WHERE ";
	for(int i = 0; i < names.size() - 1; i++)
	{
	    condition += names.get(i) + " = ? " + " AND ";
	}
	condition += names.get(names.size() - 1) + " = ?";
	return condition;
    }
    
    
    
    
    
    
    
    
    
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?