com.jpattern.orm.query.sql.SqlExecute Maven / Gradle / Ivy
package com.jpattern.orm.query.sql;
import com.jpattern.orm.query.ISqlExecute;
import com.jpattern.orm.session.ISessionSqlPerformer;
import com.jpattern.orm.session.ISqlPerformer;
/**
*
* @author Francesco Cina
*
* 09/lug/2011
*/
public class SqlExecute implements ISqlExecute {
/**
*
*/
private int queryTimeout = 0;
private final ISessionSqlPerformer session;
private final String sql;
public SqlExecute(ISessionSqlPerformer session, String sql) {
this.session = session;
this.sql = sql;
}
@Override
public void execute() {
ISqlPerformer sqlExec = session.sqlPerformer();
sqlExec.setQueryTimeout(getQueryTimeout());
sqlExec.execute(sql);
}
@Override
public void setQueryTimeout(int queryTimeout) {
this.queryTimeout = queryTimeout;
}
@Override
public int getQueryTimeout() {
return queryTimeout;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy