本文整理汇总了Java中com.almworks.sqlite4java.SQLiteException类的典型用法代码示例。如果您正苦于以下问题:Java SQLiteException类的具体用法?Java SQLiteException怎么用?Java SQLiteException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLiteException类属于com.almworks.sqlite4java包,在下文中一共展示了SQLiteException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processTuple
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public void processTuple(int tableNum, HashMap<String, Object> tuple)
{
InputSchema inputSchema = inputSchemas.get(tableNum);
SQLiteStatement insertStatement = insertStatements.get(tableNum);
try {
for (Map.Entry<String, Object> entry : tuple.entrySet()) {
ColumnInfo t = inputSchema.columnInfoMap.get(entry.getKey());
if (t != null && t.bindIndex != 0) {
insertStatement.bind(t.bindIndex, entry.getValue().toString());
}
}
insertStatement.step();
insertStatement.reset();
} catch (SQLiteException ex) {
throw new RuntimeException(ex);
}
}
开发者ID:apache,项目名称:apex-malhar,代码行数:21,代码来源:SqliteStreamOperator.java
示例2: CardsManager
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
private CardsManager() throws SQLiteException {
SQLiteConnection db = new SQLiteConnection(new File(YGOCoreMain.getConfigurator().getDataBasePath()));
db.open(true);
SQLiteStatement st = db.prepare("SELECT id, ot, alias, type, level, race, attribute, atk, def FROM datas");
try {
while(st.step()) {
int id = st.columnInt(0);
Card c = new Card(id, st.columnInt(1));
c.alias = st.columnInt(2);
c.setcode = st.columnInt(3);
int levelinfo = st.columnInt(4);
c.level = levelinfo & 0xff;
c.lscale = (levelinfo >> 24) & 0xff;
c.rscale = (levelinfo >> 16) & 0xff;
c.race = st.columnInt(6);
c.attr = st.columnInt(7);
c.attack = st.columnInt(8);
c.defense = st.columnInt(9);
mCards.put(id, c);
}
} finally {
st.dispose();
}
db.dispose();
}
开发者ID:garymabin,项目名称:JYGOServer,代码行数:27,代码来源:CardsManager.java
示例3: getRunSliceIdsForMzRange
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
/**
* Gets the run slice ids for mz range.
*
* @param minMz
* the min mz
* @param maxMz
* the max mz
* @param msLevel
* the ms level
* @param connection
* the connection
* @return the run slice ids for mz range
* @throws SQLiteException
* the sQ lite exception
*/
protected int[] getRunSliceIdsForMzRange(double minMz, double maxMz, int msLevel, SQLiteConnection connection) throws SQLiteException {
RunSliceHeader firstRunSlice = this.getRunSliceForMz(minMz, msLevel, connection);
RunSliceHeader lastRunSlice = this.getRunSliceForMz(maxMz, msLevel, connection);
double mzHeight = (msLevel == 1) ? this.getMzDbReader().getBBSizes().BB_MZ_HEIGHT_MS1 : this.getMzDbReader().getBBSizes().BB_MZ_HEIGHT_MSn;
int bufferLength = 1 + (int) ((maxMz - minMz) / mzHeight);
String queryStr = "SELECT id FROM run_slice WHERE ms_level = ? AND begin_mz >= ? AND end_mz <= ?";
return new SQLiteQuery(connection, queryStr)
.bind(1, msLevel)
.bind(2, firstRunSlice.getBeginMz())
.bind(3, lastRunSlice.getEndMz())
.extractInts(bufferLength);
}
开发者ID:mzdb,项目名称:mzdb-access,代码行数:32,代码来源:AbstractRunSliceHeaderReader.java
示例4: findExpiredLeases
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
protected List<DhcpLease> findExpiredLeases(final byte iatype) {
SQLiteConnection connection = null;
SQLiteStatement statement = null;
try {
connection = getSQLiteConnection();
statement = connection.prepare(
"select * from dhcplease" +
" where iatype = ?" +
" and state != " + IaAddress.STATIC +
" and validendtime < ? order by validendtime");
statement.bind(1, iatype);
statement.bind(2, new Date().getTime());
return mapLeases(statement);
}
catch (SQLiteException ex) {
log.error("findExpiredLeases failed", ex);
throw new RuntimeException(ex);
}
finally {
closeStatement(statement);
closeConnection(connection);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:25,代码来源:SqliteLeaseManager.java
示例5: SQLiteQuery
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
public SQLiteQuery(SQLiteConnection connection, String sqlQuery, boolean cacheStmt)
throws SQLiteException {
super();
this.queryString = sqlQuery;
this.stmt = connection.prepare(sqlQuery, cacheStmt);
HashMap<String, Integer> colIdxByColName = new HashMap<String, Integer>();
int nbCols = stmt.columnCount();
for (int colIdx = 0; colIdx < nbCols; colIdx++) {
String colName = stmt.getColumnName(colIdx);
colIdxByColName.put(colName, colIdx);
}
this.resultDesc = new SQLiteResultDescriptor(colIdxByColName);
}
开发者ID:mzdb,项目名称:mzdb-access,代码行数:18,代码来源:SQLiteQuery.java
示例6: deleteAllIAs
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
/**
* For unit tests only
*/
public void deleteAllIAs() {
SQLiteConnection connection = null;
SQLiteStatement statement = null;
try {
connection = getSQLiteConnection();
connection.exec("delete from dhcplease");
}
catch (SQLiteException ex) {
log.error("deleteAllIAs failed", ex);
throw new RuntimeException(ex);
}
finally {
closeStatement(statement);
closeConnection(connection);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:20,代码来源:SqliteLeaseManager.java
示例7: findExpiredIaPrefixes
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public List<IaPrefix> findExpiredIaPrefixes() {
SQLiteConnection connection = null;
SQLiteStatement statement = null;
try {
connection = getSQLiteConnection();
statement = connection.prepare(
"select * from dhcplease" +
" where iatype = " + IdentityAssoc.PD_TYPE +
" and validendtime < ? order by validendtime");
statement.bind(1, new Date().getTime());
List<DhcpLease> leases = mapLeases(statement);
return toIaPrefixes(leases);
}
catch (SQLiteException ex) {
log.error("findExpiredIaPrefixes failed", ex);
throw new RuntimeException(ex);
}
finally {
closeStatement(statement);
closeConnection(connection);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:24,代码来源:SqliteLeaseManager.java
示例8: beginWindow
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public void beginWindow(long windowId)
{
try {
beginStatement.step();
beginStatement.reset();
} catch (SQLiteException ex) {
throw new RuntimeException(ex);
}
}
开发者ID:apache,项目名称:apex-malhar,代码行数:11,代码来源:SqliteStreamOperator.java
示例9: endWindow
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public void endWindow()
{
try {
commitStatement.step();
commitStatement.reset();
if (bindings != null) {
for (int i = 0; i < bindings.size(); i++) {
execStatement.bind(i, bindings.get(i).toString());
}
}
int columnCount = execStatement.columnCount();
while (execStatement.step()) {
HashMap<String, Object> resultRow = new HashMap<String, Object>();
for (int i = 0; i < columnCount; i++) {
resultRow.put(execStatement.getColumnName(i), execStatement.columnValue(i));
}
this.result.emit(resultRow);
}
execStatement.reset();
for (SQLiteStatement st : deleteStatements) {
st.step();
st.reset();
}
} catch (SQLiteException ex) {
throw new RuntimeException(ex);
}
bindings = null;
}
开发者ID:apache,项目名称:apex-malhar,代码行数:31,代码来源:SqliteStreamOperator.java
示例10: peekInstance
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
public static CardsManager peekInstance() {
if (INSTANCE == null) {
try {
INSTANCE = new CardsManager();
} catch (SQLiteException e) {
log.log(Level.SEVERE,"can not load cards database :{0}", e.getMessage());
}
}
return INSTANCE;
}
开发者ID:garymabin,项目名称:JYGOServer,代码行数:11,代码来源:CardsManager.java
示例11: insertDhcpLease
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
/**
* Insert dhcp lease.
*
* @param lease the lease
*/
protected void insertDhcpLease(final DhcpLease lease)
{
SQLiteConnection connection = null;
SQLiteStatement statement = null;
try {
connection = getSQLiteConnection();
statement = connection.prepare("insert into dhcplease" +
" (ipaddress, duid, iatype, iaid, prefixlen, state," +
" starttime, preferredendtime, validendtime," +
" ia_options, ipaddr_options)" +
" values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
statement.bind(1, lease.getIpAddress().getAddress());
statement.bind(2, lease.getDuid());
statement.bind(3, lease.getIatype());
statement.bind(4, lease.getIaid());
statement.bind(5, lease.getPrefixLength());
statement.bind(6, lease.getState());
statement.bind(7, lease.getStartTime().getTime());
statement.bind(8, lease.getPreferredEndTime().getTime());
statement.bind(9, lease.getValidEndTime().getTime());
statement.bind(10, encodeOptions(lease.getIaDhcpOptions()));
statement.bind(11, encodeOptions(lease.getIaAddrDhcpOptions()));
while (statement.step()) {
log.debug("insertDhcpLease: step=true");
}
}
catch (SQLiteException ex) {
log.error("insertDhcpLease failed", ex);
throw new RuntimeException(ex);
}
finally {
closeStatement(statement);
closeConnection(connection);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:42,代码来源:SqliteLeaseManager.java
示例12: createMgf
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
private static void createMgf(CreateMgfCommand cmd) throws SQLiteException, IOException, ClassNotFoundException {
logger.info("Creating MGF File for mzDB at: " + cmd.mzdbFile);
logger.info("Precursor m/z values will be defined using the method: " + cmd.precMzComputation);
MgfWriter writer = new MgfWriter(cmd.mzdbFile, cmd.msLevel);
writer.write(cmd.outputFile, cmd.precMzComputation, cmd.mzTolPPM, cmd.intensityCutoff, cmd.exportProlineTitle);
}
开发者ID:mzdb,项目名称:mzdb-access,代码行数:9,代码来源:MzDbAccess.java
示例13: nativeExecute
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Implementation
public static void nativeExecute(final int connectionPtr, final int statementPtr) {
if (statementPtr == IGNORED_REINDEX_STMT) { return; } // TODO
CONNECTIONS.execute("execute", new Callable<Object>() {
@Override
public Object call() throws SQLiteException {
SQLiteStatement stmt = stmt(connectionPtr, statementPtr);
stmt.stepThrough();
return null;
}
});
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:13,代码来源:ShadowSQLiteConnection.java
示例14: nativeExecuteForString
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Implementation
public static String nativeExecuteForString(final int connectionPtr, final int statementPtr) {
return CONNECTIONS.execute("execute for string", new Callable<String>() {
@Override
public String call() throws SQLiteException {
SQLiteStatement stmt = stmt(connectionPtr, statementPtr);
if (!stmt.step()) {
throw new SQLiteDoneException();
}
return stmt.columnString(0);
}
});
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:14,代码来源:ShadowSQLiteConnection.java
示例15: nativeGetColumnCount
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Implementation
public static int nativeGetColumnCount(final int connectionPtr, final int statementPtr) {
return CONNECTIONS.execute("get columns count", new Callable<Integer>() {
@Override
public Integer call() throws SQLiteException {
SQLiteStatement stmt = stmt(connectionPtr, statementPtr);
return stmt.columnCount();
}
});
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:11,代码来源:ShadowSQLiteConnection.java
示例16: nativeGetColumnName
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Implementation
public static String nativeGetColumnName(final int connectionPtr, final int statementPtr, final int index) {
return CONNECTIONS.execute("get column name at index " + index, new Callable<String>() {
@Override
public String call() throws SQLiteException {
SQLiteStatement stmt = stmt(connectionPtr, statementPtr);
return stmt.getColumnName(index);
}
});
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:11,代码来源:ShadowSQLiteConnection.java
示例17: loadFromDirectory
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
private void loadFromDirectory(final File libPath) {
// configure less verbose logging
Logger.getLogger("com.almworks.sqlite4java").setLevel(Level.WARNING);
SQLite.setLibraryPath(libPath.getAbsolutePath());
try {
log("SQLite version: library " + SQLite.getLibraryVersion() + " / core " + SQLite.getSQLiteVersion());
} catch (SQLiteException e) {
throw new RuntimeException(e);
}
loaded = true;
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:13,代码来源:SQLiteLibraryLoader.java
示例18: execSQL
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public void execSQL(String sql) throws SQLException {
Misc.checkNotNullOrEmpty(sql.trim(), "Input SQL");
try {
getConnection().exec(sql);
} catch (SQLiteException e) {
throw new SQLException(e);
}
}
开发者ID:cloudant,项目名称:sync-android,代码行数:10,代码来源:SQLiteWrapper.java
示例19: rawQuery
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
@Override
public SQLiteCursor rawQuery(String sql, String[] bindArgs) throws SQLException {
try {
return SQLiteWrapperUtils.buildSQLiteCursor(getConnection(), sql, bindArgs);
} catch (SQLiteException e) {
throw new SQLException(e);
}
}
开发者ID:cloudant,项目名称:sync-android,代码行数:9,代码来源:SQLiteWrapper.java
示例20: getColumnsInTable
import com.almworks.sqlite4java.SQLiteException; //导入依赖的package包/类
/**
* Returns all columns in the table and their type
*
* @param db
* @param tablename
* @return
* @throws SQLiteException
*/
private static Map<String, String> getColumnsInTable(SQLiteConnection db, String tablename) throws SQLiteException
{
Map<String, String> columnsInTable = Maps.newHashMap();
SQLiteStatement sColumns = db.prepare("pragma table_info(" + tablename + ");");
while (sColumns.step())
{
columnsInTable.put(sColumns.columnString(1).toLowerCase(), sColumns.columnString(2).toUpperCase());
}
sColumns.dispose();
return columnsInTable;
}
开发者ID:StoragePerformanceAnalyzer,项目名称:SPA,代码行数:21,代码来源:SQLiteHelper.java
注:本文中的com.almworks.sqlite4java.SQLiteException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论