All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.luohaha.LuoORM.DBExecuter.DBExecuter Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package com.github.luohaha.LuoORM.DBExecuter;

import java.sql.SQLException;
import java.util.List;
import com.github.luohaha.LuoORM.ExecuteSQL;
import com.github.luohaha.LuoORM.DBPool.DBPool;
import com.github.luohaha.LuoORM.Table.Processor;


public class DBExecuter {
	private DBPool s;
	
	public DBExecuter(DBPool pool) {
		this.s = pool;
	}
	
	public void closePool() throws SQLException {
		this.s.closePool();
	}
	
	public static DBExecuter use(DBPool pool) {
		return new DBExecuter(pool);
	}

	public DBExecuter execute(String sql) {
		// TODO Auto-generated method stub
		ExecuteSQL.executeSingelSQL(s, sql);
		return this;
	}

	public DBExecuter executeBatch(List sqls) {
		// TODO Auto-generated method stub
		ExecuteSQL.executeSQLBatch(s, sqls);
		return this;
	}

	public Object executeAndReturn(String sql, Class c) {
		return Processor.RowSetToObject(ExecuteSQL.executeSQLAndReturn(s, sql), c);
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy