MatrixOne 的 JDBC 功能支持列表
使用 JDBC 开发应用,MatrixOne 支持以下类和对象:
1. Connection(类):获取数据库连接对象
类中的方法
-
获取执行 Sql 对象 Statement
- Statement createStatement();
- Statement prepareStatement(String sql);
-
管理事务
- 开启事务:setAutoCommit(boolean autoCommit):调用该方法设置参数为 false,即开启事务
- 提交事务:void commit()
- 回滚事务:void rollback()
connection 接口中的方法 | 支持(Y)/不支持(N) |
---|---|
createStatement() | Y |
prepareStatement(String sql) | Y |
prepareCall(String sql) | Y |
nativeSQL(String sql) | Y |
setAutoCommit(boolean autoCommit) | Y |
getAutoCommit() | Y |
commit() | Y |
rollback() | Y |
close() | Y |
isClosed() | Y |
getMetaData() | Y |
setReadOnly(boolean readOnly) | Y |
isReadOnly() | Y |
setCatalog() | Y |
getCatalog() | Y |
setTransactionIsolation(int level) | N |
getTransactionIsolation() | N |
getWarnings() | N |
clearWarnings() | N |
createStatement(int resultSetType, int resultSetConcurrency) | Y |
prepareStatement(String sql, int resultSetType, int resultSetConcurrency) | Y |
prepareCall(String sql, int resultSetType, int resultSetConcurrency) | Y |
getTypeMap() | N |
setTypeMap(java.util.Map<String,Class<?>> map) | N |
setHoldability(int holdability) | N |
getHoldability() | N |
setSavepoint() | N |
setSavepoint(String name) | N |
rollback(Savepoint savepoint) | N |
releaseSavepoint(Savepoint savepoint) | N |
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) | Y |
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | Y |
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | Y |
prepareStatement(String sql, int autoGeneratedKeys) | Y |
prepareStatement(String sql, int columnIndexes[]) | Y |
prepareStatement(String sql, String columnNames[]) | Y |
createClob() | N |
createBlob() | N |
createNClob() | N |
createSQLXML() | N |
isValid() | Y |
setClientInfo(String name, String value) | N |
setClientInfo(Properties properties) | N |
getClientInfo(String name) | N |
getClientInfo() | N |
createArrayOf(String typeName, Object[] elements) | N |
createStruct(String typeName, Object[] attributes) | N |
setSchema(String schema) | N |
getSchema() | N |
abort(Executor executor) | N |
setNetworkTimeout(Executor executor, int milliseconds) | Y |
getNetworkTimeout() | Y |
2. Statement 类中的方法
Statement 类中的方法 | 支持(Y)/不支持(N) |
---|---|
executeQuery(String sql) | Y |
executeUpdate(String sql) | Y |
close() | Y |
getMaxFieldSize() | Y |
setMaxFieldSize() | Y |
getMaxRows() | Y |
setMaxRows() | Y |
setEscapeProcessing() | N |
getQueryTimeout() | Y |
setQueryTimeout(int seconds) | Y |
cancel() | Y |
getWarnings() | N |
clearWarnings() | N |
setCursorName(String name) | N |
execute(String sql) | Y |
getResultSet() | Y |
getUpdateCount() | Y |
getMoreResults() | Y |
setFetchDirection(int direction) | Y |
getFetchDirection() | N |
setFetchSize(int rows) | Y |
getFetchSize() | Y |
getResultSetConcurrency() | Y |
getResultSetType() | Y |
addBatch( String sql) | Y |
clearBatch() | Y |
executeBatch() | Y |
getConnection() | Y |
getMoreResults(int current) | Y |
getGeneratedKeys() | Y |
executeUpdate(String sql, int autoGeneratedKeys) | Y |
executeUpdate(String sql, int columnIndexes[]) | Y |
executeUpdate(String sql, String columnNames[]) | Y |
execute(String sql, int autoGeneratedKeys) | Y |
execute(String sql, int columnIndexes[]) | Y |
execute(String sql, String columnNames[]) | Y |
getResultSetHoldability() | Y |
isClosed() | Y |
setPoolable(boolean poolable) | N |
isPoolable() | N |
closeOnCompletion() | Y |
isCloseOnCompletion() | Y |
3. ResultSet interface 中的方法
ResultSet 类中的方法 | 支持(Y)/不支持(N) |
---|---|
next() | Y |
close() | Y |
wasNull() | Y |
getString(int columnIndex) | Y |
getBoolean(int columnIndex) | Y |
getByte(int columnIndex) | Y |
getShort(int columnIndex) | Y |
getInt(int columnIndex) | Y |
getLong(int columnIndex) | Y |
getFloat(int columnIndex) | Y |
getDouble(int columnIndex) | Y |
getBigDecimal(int columnIndex, int scale) | Y |
getBytes(int columnIndex) | Y |
getDate(int columnIndex) | Y |
getTime(int columnIndex) | Y |
getTimestamp(int columnIndex) | Y |
getAsciiStream(int columnIndex) | Y |
getUnicodeStream(int columnIndex) | Y |
getBinaryStream(int columnIndex) | Y |
getWarnings() | N |
clearWarnings() | N |
getCursorName() | N |
getMetaData() | Y |
getObject() | N |
findColumn() | Y |
getCharacterStream() | Y |
isBeforeFirst() | Y |
isAfterLast() | Y |
isFirst() | Y |
isLast() | Y |
beforeFirst() | Y |
afterLast() | Y |
first() | Y |
last() | Y |
getRow() | Y |
absolute() | Y |
relative() | Y |
previous() | Y |
setFetchDirection() | Y |
getFetchDirection() | Y |
setFetchSize() | Y |
getFetchSize() | Y |
getType() | Y |
getConcurrency() | Y |
rowUpdated() | Y |
rowInserted() | Y |
rowDeleted() | Y |
update()(一连串数据类型) | Y |
updateNull() | Y |
4. ResultSetMetaData 中的方法
ResultSetMetaData 类中的方法 | 支持(Y)/不支持(N) |
---|---|
getColumnCount() | Y |
isAutoIncrement() | Y |
isCaseSensitive() | Y |
isSearchable() | Y |
isCurrency() | Y |
isNullable() | Y |
isSigned() | Y |
getColumnDisplaySize() | Y |
getColumnLabel() | Y |
getColumnName() | Y |
getSchemaName() | N |
getPrecision() | Y |
getScale() | Y |
getTableName() | Y |
getCatalogName() | Y |
getColumnType() | Y |
getColumnTypeName() | Y |
isReadOnly() | N |
isWritable() | N |
isDefinitelyWritable() | N |
getColumnClassName() | Y |
Mysql 各数据类型 DisplaySize、Prec、Scale 统计
数据类型 | DisplaySize | Prec | Scale |
---|---|---|---|
TINYINT | 4 | 4 | 0 |
SMALLINT | 6 | 6 | 0 |
INT | 11 | 11 | 0 |
BIGINT | 20 | 20 | 0 |
TINYINT UNSIGNED | 3 | 3 | 0 |
SMALLINT UNSIGNED | 5 | 5 | 0 |
INT UNSIGNED | 10 | 10 | 0 |
BIGINT UNSIGNED | 20 | 20 | 0 |
DECIMAL64(根据实际情况) | 17 | 15 | 2 |
DECIMAL128(根据实际情况) | 23 | 21 | 3 |
FLOAT | 12 | 12 | 31 |
DOUBLE | 22 | 22 | 31 |
VARCHAR(根据实际情况) | 100 | 100 | 0 |
CHAR(根据实际情况) | 100 | 100 | 0 |
DATE | 10 | 10 | 0 |
DATETIME | 19 | 19 | 0 |
TIMESTAMP | 19 | 19 | 0 |
JSON | 2147483647 | 2147483647 | 0 |