Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ba89a628
提交
ba89a628
authored
11月 27, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Android API support (work in progress).
上级
e98c67c8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
1774 行增加
和
0 行删除
+1774
-0
H2AbortException.java
h2/src/tools/org/h2/android/H2AbortException.java
+22
-0
H2Closable.java
h2/src/tools/org/h2/android/H2Closable.java
+48
-0
H2ConstraintException.java
h2/src/tools/org/h2/android/H2ConstraintException.java
+22
-0
H2Cursor.java
h2/src/tools/org/h2/android/H2Cursor.java
+248
-0
H2CursorDriver.java
h2/src/tools/org/h2/android/H2CursorDriver.java
+48
-0
H2Database.java
h2/src/tools/org/h2/android/H2Database.java
+637
-0
H2DatabaseCorruptException.java
h2/src/tools/org/h2/android/H2DatabaseCorruptException.java
+16
-0
H2DiskIOException.java
h2/src/tools/org/h2/android/H2DiskIOException.java
+16
-0
H2DoneException.java
h2/src/tools/org/h2/android/H2DoneException.java
+18
-0
H2Exception.java
h2/src/tools/org/h2/android/H2Exception.java
+23
-0
H2FullException.java
h2/src/tools/org/h2/android/H2FullException.java
+21
-0
H2MisuseException.java
h2/src/tools/org/h2/android/H2MisuseException.java
+21
-0
H2OpenHelper.java
h2/src/tools/org/h2/android/H2OpenHelper.java
+79
-0
H2Program.java
h2/src/tools/org/h2/android/H2Program.java
+117
-0
H2Query.java
h2/src/tools/org/h2/android/H2Query.java
+65
-0
H2QueryBuilder.java
h2/src/tools/org/h2/android/H2QueryBuilder.java
+228
-0
H2Statement.java
h2/src/tools/org/h2/android/H2Statement.java
+77
-0
H2TransactionListener.java
h2/src/tools/org/h2/android/H2TransactionListener.java
+28
-0
H2Utils.java
h2/src/tools/org/h2/android/H2Utils.java
+25
-0
package.html
h2/src/tools/org/h2/android/package.html
+15
-0
没有找到文件。
h2/src/tools/org/h2/android/H2AbortException.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* This exception is thrown when the operation was aborted.
*/
public
class
H2AbortException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2AbortException
()
{
super
();
}
H2AbortException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2Closable.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
android.database.sqlite.SQLiteClosable
;
/**
* An object that can be closed.
*/
public
abstract
class
H2Closable
extends
SQLiteClosable
{
/**
* TODO
*/
public
void
acquireReference
()
{
// TODO
}
/**
* TODO
*/
public
void
releaseReference
()
{
// TODO
}
/**
* TODO
*/
public
void
releaseReferenceFromContainer
()
{
// TODO
}
/**
* TODO
*/
protected
abstract
void
onAllReferencesReleased
();
/**
* TODO
*/
protected
void
onAllReferencesReleasedFromContainer
()
{
// TODO
}
}
h2/src/tools/org/h2/android/H2ConstraintException.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* This exception is thrown when a constraint was violated.
*/
public
class
H2ConstraintException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2ConstraintException
()
{
super
();
}
H2ConstraintException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2Cursor.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
android.content.ContentResolver
;
import
android.database.AbstractWindowedCursor
;
import
android.database.CharArrayBuffer
;
import
android.database.ContentObserver
;
import
android.database.CursorWindow
;
import
android.database.DataSetObserver
;
import
android.net.Uri
;
import
android.os.Bundle
;
/**
* A cursor implementation.
*/
public
class
H2Cursor
extends
AbstractWindowedCursor
{
private
H2Database
database
;
H2Cursor
(
H2Database
db
,
H2CursorDriver
driver
,
String
editTable
,
H2Query
query
)
{
// TODO
}
public
void
close
()
{
// TODO
}
public
void
deactivate
()
{
// TODO
}
public
int
getColumnIndex
(
String
columnName
)
{
return
0
;
}
public
String
[]
getColumnNames
()
{
return
null
;
}
public
int
getCount
()
{
return
0
;
}
/**
* Get the database that created this cursor.
*
* @return the database
*/
public
H2Database
getDatabase
()
{
return
database
;
}
/**
* The cursor moved to a new position.
*
* @param oldPosition the previous position
* @param newPosition the new position
* @return TODO
*/
public
boolean
onMove
(
int
oldPosition
,
int
newPosition
)
{
return
false
;
}
public
void
registerDataSetObserver
(
DataSetObserver
observer
)
{
// TODO
}
public
boolean
requery
()
{
return
false
;
}
/**
* Set the parameter values.
*
* @param selectionArgs the parameter values
*/
public
void
setSelectionArguments
(
String
[]
selectionArgs
)
{
// TODO
}
/**
* TODO
*
* @param window the window
*/
public
void
setWindow
(
CursorWindow
window
)
{
// TODO
}
public
boolean
move
(
int
offset
)
{
return
false
;
}
public
void
copyStringToBuffer
(
int
columnIndex
,
CharArrayBuffer
buffer
)
{
// TODO
}
public
byte
[]
getBlob
(
int
columnIndex
)
{
// TODO
return
null
;
}
public
int
getColumnCount
()
{
// TODO
return
0
;
}
public
int
getColumnIndexOrThrow
(
String
columnName
)
{
// TODO
return
0
;
}
public
String
getColumnName
(
int
columnIndex
)
{
// TODO
return
null
;
}
public
double
getDouble
(
int
columnIndex
)
{
// TODO
return
0
;
}
public
Bundle
getExtras
()
{
// TODO
return
null
;
}
public
float
getFloat
(
int
columnIndex
)
{
// TODO
return
0
;
}
public
int
getInt
(
int
columnIndex
)
{
// TODO
return
0
;
}
public
long
getLong
(
int
columnIndex
)
{
// TODO
return
0
;
}
public
int
getPosition
()
{
// TODO
return
0
;
}
public
short
getShort
(
int
columnIndex
)
{
// TODO
return
0
;
}
public
String
getString
(
int
columnIndex
)
{
// TODO
return
null
;
}
public
boolean
getWantsAllOnMoveCalls
()
{
// TODO
return
false
;
}
public
boolean
isAfterLast
()
{
// TODO
return
false
;
}
public
boolean
isBeforeFirst
()
{
// TODO
return
false
;
}
public
boolean
isClosed
()
{
// TODO
return
false
;
}
public
boolean
isFirst
()
{
// TODO
return
false
;
}
public
boolean
isLast
()
{
// TODO
return
false
;
}
public
boolean
isNull
(
int
columnIndex
)
{
// TODO
return
false
;
}
public
boolean
moveToFirst
()
{
// TODO
return
false
;
}
public
boolean
moveToLast
()
{
// TODO
return
false
;
}
public
boolean
moveToNext
()
{
// TODO
return
false
;
}
public
boolean
moveToPosition
(
int
position
)
{
// TODO
return
false
;
}
public
boolean
moveToPrevious
()
{
// TODO
return
false
;
}
public
void
registerContentObserver
(
ContentObserver
observer
)
{
// TODO
}
public
Bundle
respond
(
Bundle
extras
)
{
// TODO
return
null
;
}
public
void
setNotificationUri
(
ContentResolver
cr
,
Uri
uri
)
{
// TODO
}
public
void
unregisterContentObserver
(
ContentObserver
observer
)
{
// TODO
}
public
void
unregisterDataSetObserver
(
DataSetObserver
observer
)
{
// TODO
}
}
h2/src/tools/org/h2/android/H2CursorDriver.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
android.database.Cursor
;
/**
* A factory and event listener for cursors.
*/
public
interface
H2CursorDriver
{
/**
* The cursor was closed.
*/
void
cursorClosed
();
/**
* The cursor was deactivated.
*/
void
cursorDeactivated
();
/**
* The query was re-run.
*
* @param cursor the old cursor
*/
void
cursorRequeried
(
Cursor
cursor
);
/**
* Execute the query.
*
* @param factory the cursor factory
* @param bindArgs the parameter values
* @return the cursor
*/
Cursor
query
(
H2Database
.
CursorFactory
factory
,
String
[]
bindArgs
);
/**
* Set the parameter values.
*
* @param bindArgs the parameter values.
*/
void
setBindArguments
(
String
[]
bindArgs
);
}
h2/src/tools/org/h2/android/H2Database.java
0 → 100644
浏览文件 @
ba89a628
差异被折叠。
点击展开。
h2/src/tools/org/h2/android/H2DatabaseCorruptException.java
0 → 100644
浏览文件 @
ba89a628
package
org
.
h2
.
android
;
/**
* This exception is thrown when the database file is corrupt.
*/
public
class
H2DatabaseCorruptException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2DatabaseCorruptException
()
{
super
();
}
H2DatabaseCorruptException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2DiskIOException.java
0 → 100644
浏览文件 @
ba89a628
package
org
.
h2
.
android
;
/**
* This exception is thrown when there was a IO exception.
*/
public
class
H2DiskIOException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2DiskIOException
()
{
super
();
}
H2DiskIOException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2DoneException.java
0 → 100644
浏览文件 @
ba89a628
package
org
.
h2
.
android
;
/**
* This exception is thrown the requested data is not available, for example
* when calling simpleQueryForString() or simpleQueryForLong() for a statement
* that doesn't return a value.
*/
public
class
H2DoneException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2DoneException
()
{
super
();
}
H2DoneException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2Exception.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
android.database.SQLException
;
/**
* This exception is thrown when there is a syntax error or similar problem.
*/
public
class
H2Exception
extends
SQLException
{
private
static
final
long
serialVersionUID
=
1L
;
public
H2Exception
()
{
super
();
}
public
H2Exception
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2FullException.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* This exception is thrown when the database file is full and can't grow.
*/
public
class
H2FullException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2FullException
()
{
super
();
}
H2FullException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2MisuseException.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* TODO
*/
public
class
H2MisuseException
extends
H2Exception
{
private
static
final
long
serialVersionUID
=
1L
;
H2MisuseException
()
{
super
();
}
H2MisuseException
(
String
error
)
{
super
(
error
);
}
}
h2/src/tools/org/h2/android/H2OpenHelper.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
android.content.Context
;
/**
* This helper class helps creating and managing databases. A subclass typically
* implements the "on" methods.
*/
public
abstract
class
H2OpenHelper
{
/**
* Construct a new instance.
*
* @param context the context to use
* @param name the name of the database (use null for an in-memory database)
* @param factory the cursor factory to use
* @param version the expected database version
*/
H2OpenHelper
(
Context
context
,
String
name
,
H2Database
.
CursorFactory
factory
,
int
version
)
{
// TODO
}
/**
* Close the connection.
*/
public
synchronized
void
close
()
{
// TODO
}
/**
* Open a read-only connection.
*
* @return a new read-only connection
*/
public
synchronized
H2Database
getReadableDatabase
()
{
return
null
;
}
/**
* Open a read-write connection.
*
* @return a new read-write connection
*/
public
synchronized
H2Database
getWritableDatabase
()
{
return
null
;
}
/**
* This method is called when the database did not already exist.
*
* @param db the connection
*/
public
abstract
void
onCreate
(
H2Database
db
);
/**
* This method is called after opening the database.
*
* @param db the connection
*/
public
void
onOpen
(
H2Database
db
)
{
// TODO
}
/**
* This method is called when the version stored in the database file does
* not match the expected value.
*
* @param db the connection
* @param oldVersion the current version
* @param newVersion the expected version
*/
public
abstract
void
onUpgrade
(
H2Database
db
,
int
oldVersion
,
int
newVersion
);
}
h2/src/tools/org/h2/android/H2Program.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
org.h2.command.Prepared
;
import
org.h2.expression.Parameter
;
import
org.h2.value.ValueBytes
;
/**
* This class represents a prepared statement.
*/
public
class
H2Program
extends
H2Closable
{
/**
* The prepared statement
*/
protected
final
Prepared
prepared
;
H2Program
(
Prepared
prepared
)
{
this
.
prepared
=
prepared
;
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindBlob
(
int
index
,
byte
[]
value
)
{
getParameter
(
index
).
setValue
(
ValueBytes
.
get
(
value
));
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindDouble
(
int
index
,
double
value
)
{
// TODO
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindLong
(
int
index
,
long
value
)
{
// TODO
}
/**
* Set the specified parameter to NULL.
*
* @param index the parameter index (0, 1,...)
*/
public
void
bindNull
(
int
index
)
{
// TODO
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindString
(
int
index
,
String
value
)
{
// TODO
}
/**
* Reset all parameter values.
*/
public
void
clearBindings
()
{
// TODO
}
/**
* Close the statement.
*/
public
void
close
()
{
// TODO
}
/**
* Get the unique id of this statement.
*
* @return the id
*/
public
final
int
getUniqueId
()
{
return
0
;
}
/**
* TODO
*/
protected
void
onAllReferencesReleased
()
{
// TODO
}
/**
* TODO
*/
protected
void
onAllReferencesReleasedFromContainer
()
{
// TODO
}
private
Parameter
getParameter
(
int
index
)
{
return
prepared
.
getParameters
().
get
(
index
);
}
}
h2/src/tools/org/h2/android/H2Query.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
org.h2.command.Prepared
;
/**
* This class represents a prepared statement that returns a result set.
*/
public
class
H2Query
extends
H2Program
{
H2Query
(
Prepared
prepared
)
{
super
(
prepared
);
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindDouble
(
int
index
,
double
value
)
{
// TODO
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindLong
(
int
index
,
long
value
)
{
// TODO
}
/**
* Set the specified parameter to NULL.
*
* @param index the parameter index (0, 1,...)
*/
public
void
bindNull
(
int
index
)
{
// TODO
}
/**
* Set the specified parameter value.
*
* @param index the parameter index (0, 1,...)
* @param value the new value
*/
public
void
bindString
(
int
index
,
String
value
)
{
// TODO
}
/**
* Close the statement.
*/
public
void
close
()
{
// TODO
}
}
h2/src/tools/org/h2/android/H2QueryBuilder.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
java.util.Map
;
import
java.util.Set
;
import
org.h2.util.StringUtils
;
import
android.database.Cursor
;
/**
* This helper class is used to build SQL statements.
*/
public
class
H2QueryBuilder
{
private
H2Database
.
CursorFactory
factory
;
private
boolean
distinct
;
private
String
tables
;
private
Map
<
String
,
String
>
columnMap
;
/**
* Append the column to the string builder. The columns are separated by
* comma.
*
* @param s the target string builder
* @param columns the columns
*/
static
void
appendColumns
(
StringBuilder
s
,
String
[]
columns
)
{
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
if
(
i
>
0
)
{
s
.
append
(
", "
);
}
s
.
append
(
StringUtils
.
quoteIdentifier
(
columns
[
i
]));
}
}
/**
* Return the SELECT statement for the given parameters.
*
* @param distinct if only distinct rows should be returned
* @param tables the list of tables
* @param columns the list of columns
* @param where the where condition or null
* @param groupBy the group by list or null
* @param having the having condition or null
* @param orderBy the order by list or null
* @param limit the limit or null
* @return the query
*/
static
String
buildQueryString
(
boolean
distinct
,
String
tables
,
String
[]
columns
,
String
where
,
String
groupBy
,
String
having
,
String
orderBy
,
String
limit
)
{
StringBuilder
s
=
new
StringBuilder
();
s
.
append
(
"select "
);
if
(
distinct
)
{
s
.
append
(
"distinct "
);
}
appendColumns
(
s
,
columns
);
s
.
append
(
" from "
).
append
(
tables
);
if
(
where
!=
null
)
{
s
.
append
(
" where "
).
append
(
where
);
}
if
(
groupBy
!=
null
)
{
s
.
append
(
" group by "
).
append
(
groupBy
);
}
if
(
having
!=
null
)
{
s
.
append
(
" having "
).
append
(
having
);
}
if
(
orderBy
!=
null
)
{
s
.
append
(
" order by "
).
append
(
groupBy
);
}
if
(
limit
!=
null
)
{
s
.
append
(
" limit "
).
append
(
limit
);
}
return
s
.
toString
();
}
/**
* Append the text to the where clause.
*
* @param inWhere the text to append
*/
void
appendWhere
(
CharSequence
inWhere
)
{
// TODO
}
/**
* Append the text to the where clause. The text is escaped.
*
* @param inWhere the text to append
*/
void
appendWhereEscapeString
(
String
inWhere
)
{
// TODO how to escape
}
/**
* Return the SELECT UNION statement for the given parameters.
*
* @param projectionIn TODO
* @param selection TODO
* @param selectionArgs TODO
* @param groupBy the group by list or null
* @param having the having condition or null
* @param orderBy the order by list or null
* @param limit the limit or null
* @return the query
*/
String
buildQuery
(
String
[]
projectionIn
,
String
selection
,
String
[]
selectionArgs
,
String
groupBy
,
String
having
,
String
orderBy
,
String
limit
)
{
return
null
;
}
/**
* Return the SELECT UNION statement for the given parameters.
*
* @param subQueries TODO
* @param orderBy the order by list or null
* @param limit the limit or null
* @return the query
*/
String
buildUnionQuery
(
String
[]
subQueries
,
String
orderBy
,
String
limit
)
{
return
null
;
}
/**
* Return the SELECT UNION statement for the given parameters.
*
* @param typeDiscriminatorColumn TODO
* @param unionColumns TODO
* @param columnsPresentInTable TODO
* @param computedColumnsOffset TODO
* @param typeDiscriminatorValue TODO
* @param selection TODO
* @param selectionArgs TODO
* @param groupBy the group by list or null
* @param having the having condition or null
* @return the query
*/
String
buildUnionSubQuery
(
String
typeDiscriminatorColumn
,
String
[]
unionColumns
,
Set
<
String
>
columnsPresentInTable
,
int
computedColumnsOffset
,
String
typeDiscriminatorValue
,
String
selection
,
String
[]
selectionArgs
,
String
groupBy
,
String
having
)
{
return
null
;
}
/**
* Get the list of tables.
*
* @return the list of tables
*/
String
getTables
()
{
return
tables
;
}
/**
* Run the query for the given parameters.
*
* @param db the connection
* @param projectionIn TODO
* @param selection TODO
* @param selectionArgs TODO
* @param groupBy the group by list or null
* @param having the having condition or null
* @param orderBy the order by list or null
* @return the cursor
*/
Cursor
query
(
H2Database
db
,
String
[]
projectionIn
,
String
selection
,
String
[]
selectionArgs
,
String
groupBy
,
String
having
,
String
orderBy
)
{
return
null
;
}
/**
* Run the query for the given parameters.
*
* @param db the connection
* @param projectionIn TODO
* @param selection TODO
* @param selectionArgs TODO
* @param groupBy the group by list or null
* @param having the having condition or null
* @param orderBy the order by list or null
* @param limit the limit or null
* @return the cursor
*/
Cursor
query
(
H2Database
db
,
String
[]
projectionIn
,
String
selection
,
String
[]
selectionArgs
,
String
groupBy
,
String
having
,
String
orderBy
,
String
limit
)
{
return
null
;
}
/**
* Set the cursor factory.
*
* @param factory the new value
*/
void
setCursorFactory
(
H2Database
.
CursorFactory
factory
)
{
this
.
factory
=
factory
;
}
/**
* Enable or disable the DISTINCT flag.
*
* @param distinct the new value
*/
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
/**
* TODO
*
* @param columnMap TODO
*/
void
setProjectionMap
(
Map
<
String
,
String
>
columnMap
)
{
this
.
columnMap
=
columnMap
;
}
/**
* Set the list of tables.
*
* @param inTables the list of tables
*/
void
setTables
(
String
inTables
)
{
this
.
tables
=
inTables
;
}
}
h2/src/tools/org/h2/android/H2Statement.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
import
org.h2.command.Prepared
;
import
org.h2.result.ResultInterface
;
import
org.h2.value.Value
;
import
org.h2.value.ValueNull
;
/**
* Represents a prepared statement.
*/
public
class
H2Statement
extends
H2Program
{
H2Statement
(
Prepared
prepared
)
{
super
(
prepared
);
}
/**
* Execute the statement.
*/
public
void
execute
()
{
if
(
prepared
.
isQuery
())
{
prepared
.
query
(
0
);
}
else
{
prepared
.
update
();
}
}
/**
* Execute the insert statement and return the id of the inserted row.
*
* @return the id of the inserted row
*/
public
long
executeInsert
()
{
return
prepared
.
update
();
}
/**
* Execute the query and return the value of the first column and row as a
* long.
*
* @return the value
*/
public
long
simpleQueryForLong
()
{
return
simpleQuery
().
getLong
();
}
/**
* Execute the query and return the value of the first column and row as a
* string.
*
* @return the value
*/
public
String
simpleQueryForString
()
{
return
simpleQuery
().
getString
();
}
private
Value
simpleQuery
()
{
ResultInterface
result
=
prepared
.
query
(
1
);
try
{
if
(
result
.
next
())
{
Value
[]
row
=
result
.
currentRow
();
if
(
row
.
length
>
0
)
{
return
row
[
0
];
}
}
}
finally
{
result
.
close
();
}
return
ValueNull
.
INSTANCE
;
}
}
h2/src/tools/org/h2/android/H2TransactionListener.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* A class that implements this interface can listen to transaction begin and
* end events.
*/
public
interface
H2TransactionListener
{
/**
* The transaction has been started.
*/
void
onBegin
();
/**
* The transaction will be committed.
*/
void
onCommit
();
/**
* The transaction will be rolled back.
*/
void
onRollback
();
}
h2/src/tools/org/h2/android/H2Utils.java
0 → 100644
浏览文件 @
ba89a628
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
android
;
/**
* Utility methods.
*/
public
class
H2Utils
{
/**
* A replacement for Context.openOrCreateDatabase.
*
* @param name the database name
* @param mode the access mode
* @param factory the cursor factory to use
* @return the database connection
*/
public
static
H2Database
openOrCreateDatabase
(
String
name
,
int
mode
,
H2Database
.
CursorFactory
factory
)
{
return
null
;
}
}
h2/src/tools/org/h2/android/package.html
0 → 100644
浏览文件 @
ba89a628
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
><p>
This package contains the H2 Android database API.
</p></body></html>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论