use of com.servoy.j2db.persistence.QuerySet in project servoy-client by Servoy.
the class ProfileDataServer method createSQLStatement.
@Override
public ISQLStatement createSQLStatement(int action, String server_name, String tableName, Object[] pkColumnData, String tid, ISQLUpdate sqlUpdate, ArrayList<TableFilter> filters) throws RemoteException, RepositoryException {
long startTime = System.currentTimeMillis();
try {
return super.createSQLStatement(action, server_name, tableName, pkColumnData, tid, sqlUpdate, filters);
} finally {
QuerySet set;
try {
set = getSQLQuerySet(server_name, sqlUpdate, filters, -1, -1, false, false);
informListeners("Query", server_name, set.getUpdate().getSql(), tid, startTime, set.getUpdate().getParameters());
} catch (RepositoryException e) {
Debug.error(e);
}
}
}
use of com.servoy.j2db.persistence.QuerySet in project servoy-client by Servoy.
the class ProfileDataServer method performCustomQuery.
/**
* @param client_id
* @param server_name
* @param driverTableName
* @param transaction_id
* @param startRow
* @param rowsToRetrieve
* @return
* @throws ServoyException
* @throws RemoteException
* @see com.servoy.j2db.dataprocessing.IDataServer#performCustomQuery(java.lang.String, java.lang.String, java.lang.String, java.lang.String, ISQLSelect, int, int)
*/
@Override
public IDataSet performCustomQuery(String client_id, String server_name, String driverTableName, String transaction_id, ISQLSelect sqlSelect, ArrayList<TableFilter> filters, int startRow, int rowsToRetrieve) throws ServoyException, RemoteException {
long startTime = System.currentTimeMillis();
try {
return super.performCustomQuery(client_id, server_name, driverTableName, transaction_id, sqlSelect, filters, startRow, rowsToRetrieve);
} finally {
QuerySet set = getSQLQuerySet(server_name, sqlSelect, filters, 0, 1, false, false);
informListeners("Query", server_name, set.getSelect().getSql(), transaction_id, startTime, set.getSelect().getParameters());
}
}
use of com.servoy.j2db.persistence.QuerySet in project servoy-client by Servoy.
the class ProfileDataServer method insertQueryResult.
/**
* @param client_id
* @param queryServerName
* @param queryTid
* @param sqlSelect the sql statement
* @param filters filters to apply
* @param distinctInMemory require distinct values but query is not distinct
* @param startRow start row normally 0
* @param rowsToRetrieve rowsToRetrieve number of rows to retrieve
* @param type query type
* @param dataSource
* @param targetServerName
* @param targetTableName when null a temporary table will be created
* @param targetTid transaction id
* @param types the column types
* @return the table where the set was inserted into
* @throws ServoyException
* @throws RemoteException
*/
@Override
public ITable insertQueryResult(String client_id, String queryServerName, String queryTid, ISQLSelect sqlSelect, ArrayList<TableFilter> filters, boolean distinctInMemory, int startRow, int rowsToRetrieve, int type, String dataSource, String targetServerName, String targetTableName, String targetTid, ColumnType[] columnTypes, String[] pkNames) throws ServoyException, RemoteException {
long startTime = System.currentTimeMillis();
try {
return super.insertQueryResult(client_id, queryServerName, queryTid, sqlSelect, filters, distinctInMemory, startRow, rowsToRetrieve, type, dataSource, targetServerName, targetTableName, targetTid, columnTypes, pkNames);
} finally {
QuerySet set = getSQLQuerySet(queryServerName, sqlSelect, filters, startRow, rowsToRetrieve, false, false);
informListeners("FillDataSource", queryServerName, set.getSelect().getSql(), queryTid, startTime, set.getSelect().getParameters());
}
}
use of com.servoy.j2db.persistence.QuerySet in project servoy-client by Servoy.
the class ProfileDataServer method getBlob.
/**
* @param clientId
* @param serverName
* @param blobSelect
* @param filters
* @param tid
* @return
* @throws RepositoryException
* @throws RemoteException
* @see com.servoy.j2db.dataprocessing.IDataServer#getBlob(java.lang.String, java.lang.String, com.servoy.j2db.query.ISQLSelect, java.util.ArrayList, java.lang.String)
*/
@Override
public Blob getBlob(String clientId, String serverName, ISQLSelect blobSelect, ArrayList<TableFilter> filters, String tid) throws RepositoryException, RemoteException {
long startTime = System.currentTimeMillis();
try {
return super.getBlob(clientId, serverName, blobSelect, filters, tid);
} finally {
QuerySet set = getSQLQuerySet(serverName, blobSelect, filters, 0, 1, false, false);
informListeners("BlobLoad", serverName, set.getSelect().getSql(), tid, startTime, set.getSelect().getParameters());
}
}
use of com.servoy.j2db.persistence.QuerySet in project servoy-client by Servoy.
the class ProfileDataServer method performQuery.
@Override
public IDataSet[] performQuery(String client_id, String server_name, String transaction_id, QueryData[] array) throws ServoyException, RemoteException {
long startTime = System.currentTimeMillis();
try {
return super.performQuery(client_id, server_name, transaction_id, array);
} finally {
int counter = 0;
long timePerQuery = (System.currentTimeMillis() - startTime) / array.length;
for (QueryData queryData : array) {
long time = System.currentTimeMillis() - timePerQuery;
QuerySet set = getSQLQuerySet(server_name, queryData.getSqlSelect(), queryData.getFilters(), queryData.getStartRow(), queryData.getRowsToRetrieve(), false, false);
informListeners(PerformanceTiming.getTypeString(queryData.getType()) + " Combined Query[" + (counter++) + '/' + array.length + ']', server_name, set.getSelect().getSql(), transaction_id, time, set.getSelect().getParameters());
}
}
}
Aggregations