com.genexus.db.DataStoreProviderBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxandroid Show documentation
Show all versions of gxandroid Show documentation
Core classes for the runtime used by Java and Android apps generated with GeneXus
package com.genexus.db;
import java.sql.SQLException;
import java.util.Date;
import com.genexus.*;
import com.genexus.common.classes.AbstractDataStoreProviderBase;
import com.genexus.common.classes.AbstractGXConnection;
import com.genexus.db.driver.DataSource;
import com.genexus.db.driver.GXConnection;
public abstract class DataStoreProviderBase extends AbstractDataStoreProviderBase
{
private IConnectionProvider connectionProvider;
protected ModelContext context;
protected int remoteHandle;
protected Cursor[] cursors;
protected DataSource dataSource;
protected GXParameterUnpacker unpacker = new GXParameterUnpacker();
protected GXParameterPacker packer = new GXParameterPacker();
protected IErrorHandler errorHandler;
protected Date beginExecute;
protected GXConnection con;
protected DataStoreProviderBase(ModelContext context, int remoteHandle)
{
this.context = context;
this.remoteHandle = remoteHandle;
}
public AbstractGXConnection getConnection() throws SQLException
{
if (connectionProvider == null)
{
connectionProvider = getHelper().getConnectionProvider();
}
con = (GXConnection) connectionProvider.getConnection(context, remoteHandle, getHelper().getDataStoreName(), getHelper().needsReadOnlyConnection(), true);
return con;
}
protected DataSource getDataSource()
{
if (dataSource == null)
dataSource = Application.getConnectionManager(context).getDataSource(remoteHandle, getHelper().getDataStoreName());
return dataSource;
}
protected DataSource getDataSourceNoException()
{
if (dataSource == null)
dataSource = Application.getConnectionManager(context).getDataSourceNoException(remoteHandle, getHelper().getDataStoreName());
return dataSource;
}
public void setErrorHandler(IErrorHandler errorHandler)
{
this.errorHandler = errorHandler;
}
protected Object [] dynConstraints = null;
public void dynParam(int cursorId, Object [] dynConstraints)
{
this.dynConstraints = dynConstraints;
}
public Object [] getDynConstraints()
{
return (Object[])dynConstraints[0];
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy