⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serversqlexecutorutils.java

📁 《j2ee开发全程实录》随书源码
💻 JAVA
字号:
package com.cownew.PIS.framework.server.helper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.cownew.PIS.framework.common.services.ISQLExecutor;

public class ServerSQLExecutorUtils
{
	public static ResultSet executeQuery(String sql, Object[] params)
			throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		return sqle.execute(sql, params);
	}

	public static ResultSet executeQuery(String sql) throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		return sqle.execute(sql);
	}

	public static void execute(String sql, Object[] params) throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		sqle.execute(sql, params);
	}

	public static void execute(String sql) throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		sqle.execute(sql);
	}

	public static void batchExecute(String[] sql) throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		sqle.batchExecute(sql);
	}

	public static void batchExecute(String[] sqlArray, Object[][] paramsArray)
			throws SQLException
	{
		ISQLExecutor sqle = (ISQLExecutor) LocalServiceLocator.getInstance()
				.getService(ISQLExecutor.class);
		sqle.batchExecute(sqlArray, paramsArray);
	}

}

⌨️ 快捷键说明

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