You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

参考资料

JDBC 4.3 Specification

https://jcp.org/aboutJava/communityprocess/mrel/jsr221/index3.html


Catalog

存储组全名,如 root.sg

Database

存储组全名,如 root.sg


Schema

存储组全名,如 root.sg


Table


  • Align by device 的表结构:
    • 默认的设备数据表:_defaultDeviceTable
    • 每个设备类型一个表
      • deviceType1
      • deviceType2
  • Align by timestamp的表结构:
    • 宽表:_defaultWideTable


Column


  • 默认的设备数据表:time,device,s1,s2, ...
  •  一个设备类型表:time,device,s1,s2, ...
  • 宽表:time,root.sg.d1.s1, root.sg.d1.s2, ...


Primary key


  • 默认的设备数据表:time,device
  • 一个设备类型表:time,device
  • 宽表:time


SQL Example:


SELECT *, ‘1’ FROM "root.sg"._defaultDeviceTable
WHERE device = ‘root.sg.d1’ AND ("time" < 4 OR s1 < 20) LIMIT 2 OFFSET 1;

SELECT *, ‘1’ FROM "root.sg".devicetype1
WHERE device = ‘root.sg.d1’ AND ("time" < 4 OR s1 < 20) LIMIT 2 OFFSET 1;

SELECT *, ‘1’ FROM "root.sg".devicetype2
WHERE device = ‘root.sg.d1’ AND ("time" < 4 OR s1 < 20) LIMIT 2 OFFSET 1;

SELECT *, ‘1’ FROM "root.sg"._defaultWideTable
WHERE device = ‘root.sg.d1’ AND ("time" < 4 OR s1 < 20) LIMIT 2 OFFSET 1;



Survey for JDBC Metadata 

metadataModifier and TypeMethodDescriptionmysql返回值itodb返回值
DatabaseMetaDatabooleanallProceduresAreCallable​()Retrieves whether the current user can call all the procedures returned by the method getProcedures.FALSEFALSE
booleanallTablesAreSelectable​()Retrieves whether the current user can use all the tables returned by the method getTables in a SELECT statement.FALSETRUE
booleanautoCommitFailureClosesAllResultSets​()Retrieves whether a SQLException while autoCommit is true indicates that all open ResultSets are closed, even ones that are holdable.FALSE需要确认结果集是否关闭itodb返回false
booleandataDefinitionCausesTransactionCommit​()Retrieves whether a data definition statement within a transaction forces the transaction to commit.TRUEFALSE
booleandataDefinitionIgnoredInTransactions​()Retrieves whether this database ignores a data definition statement within a transaction.FALSEFALSE
booleandeletesAreDetected​(int type)Retrieves whether or not a visible row delete can be detected by calling the method ResultSet.rowDeleted.FALSETRUE
booleandoesMaxRowSizeIncludeBlobs​()Retrieves whether the return value for the method getMaxRowSize includes the SQL data types LONGVARCHAR and LONGVARBINARY.TRUE暂定FALSE,后续有可能调整,代码加上批注(英文)
booleangeneratedKeyAlwaysReturned​()Retrieves whether a generated key will always be returned if the column name(s) or index(es) specified for the auto generated key column(s) are valid and the statement succeeds.TRUETRUE
ResultSet

getAttributes​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String typeNamePattern, java.lang.String attributeNamePattern)

Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog.横向列名
TYPE_CAT
TYPE_SCHEM
TYPE_NAME
ATTR_NAME
DATA_TYPE
ATTR_TYPE_NAME
ATTR_SIZE
DECIMAL_DIGITS
NUM_PREC_RADIX
NULLABLE 
REMARKS
ATTR_DEF
SQL_DATA_TYPE
SQL_DATETIME_SUB
CHAR_OCTET_LENGTH
ORDINAL_POSITION
IS_NULLABLE
SCOPE_CATALOG
SCOPE_SCHEMA
SCOPE_TABLE
SOURCE_DATA_TYPE
empty
ResultSetgetBestRowIdentifier​(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)Retrieves a description of a table's optimal set of columns that uniquely identifies a row.横向列名
SCOPE
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_SIZE
BUFFER_LENGTH
DECIMAL_DIGITS
PSEUDO_COLUMN
SCOPE
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_SIZE
BUFFER_LENGTH
DECIMAL_DIGITS
PSEUDO_COLUMN(需更新文档)
ResultSetgetCatalogs​()Retrieves the catalog names available in this database.

mysql 返回数据库列表相当于

show databases
列名TABLE_CAT
-------------
TYPE_CAT String => type catalog (may be null)

存储组(需更新文档)
java.lang.StringgetCatalogSeparator​()Retrieves the String that this database uses as the separator between a catalog and table name.mysql返回.返回表或者数据库的分隔符(暂定.)
java.lang.StringgetCatalogTerm​()Retrieves the database vendor's preferred term for "catalog".mysql 返回databasestorage group
ResultSetgetClientInfoProperties​()Retrieves a list of the client info properties that the driver supports.mysql 返回null
列名
NAME
MAX_LEN
DEFAULT_VALUE
DESCRIPTION
NAME=fetch_size
MAX_LEN=int.maxvalue
DEFAULT_VALUE=
1000
DESCRIPTION=文字描述
ResultSetgetColumnPrivileges​(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern)Retrieves a description of the access rights for a table's columns.列名:
TABLE_CAT
TABLE_SCHEM
TABLE_NAME
COLUMN_NAME
GRANTOR
GRANTEE 
PRIVILEGE 
IS_GRANTABLE 
TABLE_CAT=store group
TABLE_SCHEM=store group
TABLE_NAME
COLUMN_NAME=device+measurment
GRANTOR=null
GRANTEE =当前用户
PRIVILEGE=select、i、d
IS_GRANTABLE =false
ResultSetgetColumns​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)Retrieves a description of table columns available in the specified catalog.列名
TABLE_CAT
TABLE_SCHEM 
TABLE_NAME 
COLUMN_NAME 
DATA_TYPE 
TYPE_NAME 
COLUMN_SIZE 
BUFFER_LENGTH 
DECIMAL_DIGITS 
NUM_PREC_RADIX 
NULLABLE 
columnNoNulls 
columnNullable 
columnNullableUnknown 
REMARKS 
COLUMN_DEF 
SQL_DATA_TYPE 
SQL_DATETIME_SUB 
CHAR_OCTET_LENGTH 
ORDINAL_POSITION 
SCOPE_CATALOG 
SCOPE_SCHEMA 
SCOPE_TABLE 
SOURCE_DATA_TYPE
TABLE_CAT=null
TABLE_SCHEM =存储组全名
TABLE_NAME =
COLUMN_NAME =
DATA_TYPE =
TYPE_NAME 
COLUMN_SIZE 
BUFFER_LENGTH 
DECIMAL_DIGITS 
NUM_PREC_RADIX 
NULLABLE 
columnNoNulls 
columnNullable 
columnNullableUnknown 
REMARKS 
COLUMN_DEF 
SQL_DATA_TYPE 
SQL_DATETIME_SUB 
CHAR_OCTET_LENGTH 
ORDINAL_POSITION 
SCOPE_CATALOG 
SCOPE_SCHEMA 
SCOPE_TABLE 
SOURCE_DATA_TYPE 
ConnectiongetConnection​()Retrieves the connection that produced this metadata object.ConnectionConnection
ResultSetgetCrossReference​(java.lang.String parentCatalog, java.lang.String parentSchema, java.lang.String parentTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table).PKTABLE_CAT 
PKTABLE_SCHEM 
PKTABLE_NAME 
PKCOLUMN_NAME 
FKTABLE_CAT 
FKTABLE_SCHEM 
FKTABLE_NAME 
FKCOLUMN_NAME 
KEY_SEQ
UPDATE_RULE 
DELETE_RULE 
FK_NAME 
PK_NAME 
DEFERRABILITY 
empty
intgetDatabaseMajorVersion​()Retrieves the major version number of the underlying database.mysql主版本号5.6 返回5返回主版本号
intgetDatabaseMinorVersion​()Retrieves the minor version number of the underlying database.mysql次版本号5.6返回6返回次版本号
java.lang.StringgetDatabaseProductName​()Retrieves the name of this database product.mysqlIOTdb
java.lang.StringgetDatabaseProductVersion​()Retrieves the version number of this database product.产品版本号5.6.1产品版本号
intgetDefaultTransactionIsolation​()Retrieves this database's default transaction isolation level.返回事物隔离级别(默认脏读)返回3返回其他数值0
intgetDriverMajorVersion​()Retrieves this JDBC driver's major version number.主版本号5.1返回5主版本号
intgetDriverMinorVersion​()Retrieves this JDBC driver's minor version number.次版本号5.1返回1次版本号 
java.lang.StringgetDriverName​()Retrieves the name of this JDBC driver.驱动名称驱动名称
java.lang.StringgetDriverVersion​()Retrieves the version number of this JDBC driver as a String. 驱动版本号5.1.1 驱动版本号
ResultSetgetExportedKeys​(java.lang.String catalog, java.lang.String schema, java.lang.String table)Retrieves a description of the foreign key columns that reference the given table's primary key columns (the foreign keys exported by a table).列名
PKTABLE_CAT 
PKTABLE_SCHEM 
PKTABLE_NAME 
PKCOLUMN_NAME 
FKTABLE_CAT 
FKTABLE_SCHEM 
FKTABLE_NAME 
FKCOLUMN_NAME 
KEY_SEQ short 
UPDATE_RULE short 
DELETE_RULE short 
FK_NAME 
PK_NAME 
DEFERRABILITY 
empty
java.lang.StringgetExtraNameCharacters​()Retrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).#@空字符串
ResultSetgetFunctionColumns​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String functionNamePattern, java.lang.String columnNamePattern)Retrieves a description of the given catalog's system or user function parameters and return type.列名
FUNCTION_CAT 
FUNCTION_SCHEM 
FUNCTION_NAME 
COLUMN_NAME 
COLUMN_TYPE 
DATA_TYPE 
TYPE_NAME 
PRECISIONa
LENGTH
SCALE 
RADIX 
NULLABLE 
REMARKS 
CHAR_OCTET_LENGTH 
ORDINAL_POSITION 
IS_NULLABLE 
SPECIFIC_NAME
列名(需服务器返回)
FUNCTION_CAT 
FUNCTION_SCHEM 
FUNCTION_NAME 
COLUMN_NAME 
COLUMN_TYPE 
DATA_TYPE 
TYPE_NAME 
PRECISIONa
LENGTH
SCALE 
RADIX 
NULLABLE 
REMARKS 
CHAR_OCTET_LENGTH 
ORDINAL_POSITION 
IS_NULLABLE 
SPECIFIC_NAME
ResultSetgetFunctions​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String functionNamePattern)Retrieves a description of the system and user functions available in the given catalog.列名
FUNCTION_CAT 
FUNCTION_SCHEM
FUNCTION_NAME 
REMARKS 
FUNCTION_TYPE
SPECIFIC_NAME
列名(服务器返回)
FUNCTION_CAT 
FUNCTION_SCHEM
FUNCTION_NAME 
REMARKS 
FUNCTION_TYPE
SPECIFIC_NAME
java.lang.StringgetIdentifierQuoteString​()Retrieves the string used to quote SQL identifiers.返回`单双引号
ResultSetgetImportedKeys​(java.lang.String catalog, java.lang.String schema, java.lang.String table)Retrieves a description of the primary key columns that are referenced by the given table's foreign key columns (the primary keys imported by a table).列名:
PKTABLE_CAT 
PKTABLE_SCHEM 
PKTABLE_NAME
PKCOLUMN_NAME 
FKTABLE_CAT 
FKTABLE_SCHEM 
FKTABLE_NAME 
FKCOLUMN_NAME 
KEY_SEQ short 
UPDATE_RULE short 
DELETE_RULE short 
FK_NAME String 
PK_NAME String 
DEFERRABILITY
empty
ResultSetgetIndexInfo​(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)Retrieves a description of the given table's indices and statistics.列名
TABLE_CAT 
TABLE_SCHEM 
TABLE_NAME 
NON_UNIQUE
INDEX_QUALIFIER 
INDEX_NAME 
TYPE 
ORDINAL_POSITION 
COLUMN_NAME 
ASC_OR_DESC 
CARDINALITY 
PAGES 
FILTER_CONDITION
empty
intgetJDBCMajorVersion​()Retrieves the major JDBC version number for this driver.jdbc 主版本号jdbc 主版本号
intgetJDBCMinorVersion​()Retrieves the minor JDBC version number for this driver.jdbc次版本号jdbc次版本号
intgetMaxBinaryLiteralLength​()Retrieves the maximum number of hex characters this database allows in an inline binary literal.16777208interger.maxvalue
intgetMaxCatalogNameLength​()Retrieves the maximum number of characters that this database allows in a catalog name.321024(注释虽无限制但不建议)
intgetMaxCharLiteralLength​()Retrieves the maximum number of characters this database allows for a character literal.16777208interger.maxvalue
intgetMaxColumnNameLength​()Retrieves the maximum number of characters this database allows for a column name.641024(注释无限制不建议)
intgetMaxColumnsInGroupBy​()Retrieves the maximum number of columns this database allows in a GROUP BY clause.64group by 个数1
intgetMaxColumnsInIndex​()Retrieves the maximum number of columns this database allows in an index.确认最大索引个数160
intgetMaxColumnsInOrderBy​()Retrieves the maximum number of columns this database allows in an ORDER BY clause.64返回1
intgetMaxColumnsInSelect​()Retrieves the maximum number of columns this database allows in a SELECT list.256select最大列数(确认)
intgetMaxColumnsInTable​()Retrieves the maximum number of columns this database allows in a table.512max
intgetMaxConnections​()Retrieves the maximum number of concurrent connections to this database that are possible.最大链接(确认)服务器取
intgetMaxCursorNameLength​()Retrieves the maximum number of characters that this database allows in a cursor name.64返回0
intgetMaxIndexLength​()Retrieves the maximum number of bytes this database allows for an index, including all of the parts of the index.256integer.maxvalue
default longgetMaxLogicalLobSize​()Retrieves the maximum number of bytes this database allows for the logical size for a LOB.0integer.maxvalue
intgetMaxProcedureNameLength​()Retrieves the maximum number of characters that this database allows in a procedure name.0返回0
intgetMaxRowSize​()Retrieves the maximum number of bytes this database allows in a single row.21474836392147483639(注释无限制)
intgetMaxSchemaNameLength​()Retrieves the maximum number of characters that this database allows in a schema name.01024(注释无限制不建议)
intgetMaxStatementLength​()Retrieves the maximum number of characters this database allows in an SQL statement.65531thrift . 获取.framesize
intgetMaxStatements​()Retrieves the maximum number of active statements to this database that can be open at the same time.00
intgetMaxTableNameLength​()Retrieves the maximum number of characters this database allows in a table name.641024(注释无限制不建议)
intgetMaxTablesInSelect​()Retrieves the maximum number of tables this database allows in a SELECT statement.2561024(注释无限制不建议)
intgetMaxUserNameLength​()Retrieves the maximum number of characters this database allows in a user name.161024(注释无限制不建议)
java.lang.StringgetNumericFunctions​()Retrieves a comma-separated list of math functions available with this database.

返回函数mysql返回ABS,ACOS,ASIN,

ATAN,ATAN2,BIT_COUNT,

CEILING,COS,COT,DEGREES,EXP,

FLOOR,LOG,LOG10,MAX,MIN,

MOD,PI,POW,POWER,RADIANS,

RAND,ROUND,SIN,

SQRT,TAN,TRUNCATE**

DATABASE,USER,SYSTEM_USER,

SESSION_USER,

PASSWORD,ENCRYPT,

LAST_INSERT_ID,VERSION

服务器取
ResultSetgetPrimaryKeys​(java.lang.String catalog, java.lang.String schema, java.lang.String table)Retrieves a description of the given table's primary key columns.列名
TABLE_CAT
TABLE_SCHEM 
TABLE_NAME
COLUMN_NAME 
KEY_SEQ 
PK_NAME 
两种times、device time
ResultSetgetProcedureColumns​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern)Retrieves a description of the given catalog's stored procedure parameter and result columns.列名
PROCEDURE_CAT 
PROCEDURE_SCHEM 
PROCEDURE_NAME 
COLUMN_NAME
COLUMN_TYPE 
DATA_TYPE 
TYPE_NAME 
PRECISION 
LENGTH 
SCALE 
RADIX 
NULLABLE 
REMARKS 
COLUMN_DEF 
SQL_DATA_TYPE 
SQL_DATETIME_SUB 
CHAR_OCTET_LENGTH 
ORDINAL_POSITION 
IS_NULLABLE 
SPECIFIC_NAME
e
ResultSetgetProcedures​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern)Retrieves a description of the stored procedures available in the given catalog.列名
PROCEDURE_CAT 
PROCEDURE_SCHEM 
PROCEDURE_NAME
REMARKS String 
PROCEDURE_TYPE
SPECIFIC_NAME 
e
java.lang.StringgetProcedureTerm​()Retrieves the database vendor's preferred term for "procedure".PROCEDUREe
ResultSetgetPseudoColumns​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)Retrieves a description of the pseudo or hidden columns available in a given table within the specified catalog and schema.

列名
TABLE_CAT
TABLE_SCHEM 
TABLE_NAME
COLUMN_NAME 
DATA_TYPE 
COLUMN_SIZE 
DECIMAL_DIGITS
NUM_PREC_RADIX 
COLUMN_USAGE 
REMARKS 
CHAR_OCTET_LENGTH 
IS_NULLABLE 
伪列,例如oracle 中sysdate, systimestamp,

RowNum ,RowID, CURRVAL, NEXTVAL,UID, USER,Level,ORA_ROWSCN。

TABLE_CAT
TABLE_SCHEM 
TABLE_NAME
COLUMN_NAME 
DATA_TYPE 
COLUMN_SIZE 
DECIMAL_DIGITS
NUM_PREC_RADIX 
COLUMN_USAGE 
REMARKS 
CHAR_OCTET_LENGTH 
IS_NULLABLE (目前只有times)
intgetResultSetHoldability​()Retrieves this database's default holdability for ResultSet objects.

返回1,ResultSet的可保持性确定使用commit()

Connection

接口的方法提交事务(包含 游标/ 

ResultSet对象)时

是否应关闭ResultSet对象(光标)

或使其保持打开状态。

DatabaseMetaData接口的

getResultSetHoldability() 

方法检索基础数据库的ResultSet

对象的默认可保存性。

此方法返回一个表示默认ResultSet

可保存性的整数值,

该值将为1或2,其中,1表示值

HOLD_CURSORS_OVER_COMMIT。

如果ResultSet对象的可保存性设置为此值。

每当使用commit()Connection接口的

方法提交/保存事务时,在当前事务中创建的

ResultSet对象(已打开)将保持打开状态。
2表示值CLOSE_CURSORS_AT_COMMIT。

如果ResultSet对象的

可保存性设置为此值。每当您使用commit()Connection接口

的方法提交/保存事务时,在当前事务中创建的ResultSet

对象(已打开)将被关闭。 

返回1
RowIdLifetimegetRowIdLifetime​()Indicates whether this data source supports the SQL ROWID type, and the lifetime for which a RowId object remains valid.ROWID_UNSUPPORTEDROWID_UNSUPPORTED
ResultSetgetSchemas​()Retrieves the schema names available in this database.TABLE_SCHEM 
TABLE_CATALOG
存储组服务器获取
ResultSetgetSchemas​(java.lang.String catalog, java.lang.String schemaPattern)Retrieves the schema names available in this database.TABLE_SCHEM 
TABLE_CATALOG
存储组服务器获取
java.lang.StringgetSchemaTerm​()Retrieves the database vendor's preferred term for "schema".“”stroge group
java.lang.StringgetSearchStringEscape​()Retrieves the string that can be used to escape wildcard characters.\\
java.lang.StringgetSQLKeywords​()Retrieves a comma-separated list of all of this database's SQL keywords that are NOT also SQL:2003 keywords.输出sql关键字如:database返回不存在的antlr
intgetSQLStateType​()Indicates whether the SQLSTATE returned by SQLException.getSQLState is X/Open (now known as Open Group) SQL CLI or SQL:2003.mysql返回2(含义)返回0,返回数字表示false,mysql返回2
java.lang.StringgetStringFunctions​()Retrieves a comma-separated list of string functions available with this database.

返回函数列表例如:ASCII,BIN,

BIT_LENGTH,CHAR,

CHARACTER_LENGTH,

CHAR_LENGTH,CONCAT,

CONCAT_WS,CONV,ELT,

EXPORT_SET,FIELD,

FIND_IN_SET,HEX,INSERT,

INSTR,LCASE,LEFT,

LENGTH,LOAD_FILE,LOCATE,

LOCATE,LOWER,

LPAD,LTRIM,MAKE_SET,MATCH,MID,OCT,

OCTET_LENGTH,ORD,POSITION,

QUOTE,REPEAT,

REPLACE,REVERSE,RIGHT,RPAD,

RTRIM,SOUNDEX,

SPACE,STRCMP,SUBSTRING,

SUBSTRING,

SUBSTRING,SUBSTRING,

SUBSTRING_INDEX,TRIM,

UCASE,UPPER

服务器
ResultSet

getSuperTables​(java.lang.String catalog,

 java.lang.String schemaPattern, 

java.lang.String tableNamePattern)

Retrieves a description of the table hierarchies defined in a particular schema in this database.TABLE_CAT 
TABLE_SCHEM 
TABLE_NAME 
SUPERTABLE_NAME
e
ResultSet

getSuperTypes​(java.lang.String catalog,

 java.lang.String schemaPattern, 

java.lang.String typeNamePattern)

Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database.TYPE_CAT 
TYPE_SCHEM 
TYPE_NAME 
SUPERTYPE_CAT 
SUPERTYPE_SCHEM 
SUPERTYPE_NAME
e
java.lang.StringgetSystemFunctions​()Retrieves a comma-separated list of system functions available with this database.返回内置函数mysql返回DATABASE
USER
PASSWORD
服务器
ResultSetgetTablePrivileges​(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern)Retrieves a description of the access rights for each table available in a catalog.TABLE_CAT 
TABLE_SCHEM
TABLE_NAME 
GRANTOR 
GRANTEE 
PRIVILEGE 
IS_GRANTABLE
服务器
ResultSet

getTables​(java.lang.String catalog, 

java.lang.String schemaPattern, 

java.lang.String tableNamePattern,

 java.lang.String[] types)

Retrieves a description of the tables available in the given catalog.

TABLE_CAT 
TABLE_SCHEM  
TABLE_NAME  
TABLE_TYPE  
REMARKS 
TYPE_CAT 
TYPE_SCHEM 
TYPE_NAME 
SELF_REFERENCING_COL_NAME 
REF_GENERATION
--------------
TABLE_CAT String => table catalog (may be null)
TABLE_SCHEM String => table schema (may be null)
TABLE_NAME String => table name
TABLE_TYPE String => table type. 

Typical types are "TABLE", 

"VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", 

"LOCAL TEMPORARY",

 "ALIAS", "SYNONYM".
REMARKS String => explanatory comment on the table
TYPE_CAT String => the types catalog (may be null)
TYPE_SCHEM String => the types schema (may be null)
TYPE_NAME String => type name (may be null)
SELF_REFERENCING_COL_NAME String => name of the designated "identifier"

 column of a typed table (may be null)
REF_GENERATION String => specifies how values in SELF_REFERENCING_COL_NAME 

are created. Values are "SYSTEM", "USER", 

"DERIVED". (may be null)

TABLE_CAT 
TABLE_SCHEM  
TABLE_NAME  
TABLE_TYPE  
REMARKS 
TYPE_CAT 
TYPE_SCHEM 
TYPE_NAME 
SELF_REFERENCING_COL_NAME 
REF_GENERATION(服务器返回)
ResultSetgetTableTypes​()Retrieves the table types available in this database.TABLE_TYPE
返回表的类型mysql返回TABLE
VIEW
LOCAL TEMPORARY
table
java.lang.StringgetTimeDateFunctions​()Retrieves a comma-separated list of the time and date functions available with this database.

返回日期函数mysql返回如下DAYOFWEEK,WEEKDAY,DAYOFMONTH,

DAYOFYEAR,MONTH,DAYNAME,

MONTHNAME,QUARTER,WEEK,

YEAR,HOUR,MINUTE,SECOND,

PERIOD_ADD,PERIOD_DIFF,

TO_DAYS,FROM_DAYS,

DATE_FORMAT,TIME_FORMAT,

CURDATE,

CURRENT_DATE,CURTIME,

CURRENT_TIME,NOW,SYSDATE,

CURRENT_TIMESTAMP,

UNIX_TIMESTAMP,FROM_UNIXTIME,

SEC_TO_TIME,TIME_TO_SEC
DATABASE,USER,SYSTEM_USER,

SESSION_USER,PASSWORD,

ENCRYPT,LAST_INSERT_ID,VERSION

now(服务器返回)
ResultSetgetTypeInfo​()Retrieves a description of all the data types supported by this database.检索当前数据库支持的所有标准 SQL 类型的说明,
TYPE_NAME 
DATA_TYPE 
PRECISION 
LITERAL_PREFIX 
LITERAL_SUFFIX 
CREATE_PARAMS 
NULLABLE short 
CASE_SENSITIVE 
SEARCHABLE 
UNSIGNED_ATTRIBUTE 
FIXED_PREC_SCALE 
AUTO_INCREMENT 
LOCAL_TYPE_NAME 
MINIMUM_SCALE 
MAXIMUM_SCALE 
SQL_DATA_TYPE 
SQL_DATETIME_SUB 
NUM_PREC_RADIX 
服务器
ResultSet

getUDTs​(java.lang.String catalog, j

ava.lang.String schemaPattern, 

java.lang.String typeNamePattern,

 int[] types)

Retrieves a description of the user-defined types (UDTs) defined in a particular schema.TYPE_CAT 
TYPE_SCHEM 
TYPE_NAME 
CLASS_NAME 
DATA_TYPE
REMARKS
BASE_TYPE
e
java.lang.StringgetURL​()Retrieves the URL for this DBMS.

mysql返回

jdbc:mysql://IP:port/gonghui_data?useSSL=false

返回url
java.lang.StringgetUserName​()Retrieves the user name as known to this database.返回用户名username@219.142.240.74返回用户名username@219.142.240.74
ResultSet

getVersionColumns​(java.lang.String catalog, java.lang.String schema,

 java.lang.String table)

Retrieves a description of a table's columns that are automatically updated when any value in a row is updated.列名
SCOPE 
COLUMN_NAME 
DATA_TYPE 
TYPE_NAME 
COLUMN_SIZE 
BUFFER_LENGTH 
DECIMAL_DIGITS 
PSEUDO_COLUMN 
e
booleaninsertsAreDetected​(int type)Retrieves whether or not a visible row insert can be detected by calling the method ResultSet.rowInserted.FALSEFALSE
booleanisCatalogAtStart​()Retrieves whether a catalog appears at the start of a fully qualified table name.TRUEFALSE
booleanisReadOnly​()Retrieves whether this database is in read-only mode.FALSE服务器返回
booleanlocatorsUpdateCopy​()Indicates whether updates made to a LOB are made on a copy or directly to the LOB.TRUEFALSE
booleannullPlusNonNullIsNull​()Retrieves whether this database supports concatenations between NULL and non-NULL values being NULL.TRUEFALSE
booleannullsAreSortedAtEnd​()Retrieves whether NULL values are sorted at the end regardless of sort order.FALSEFALSE
booleannullsAreSortedAtStart​()Retrieves whether NULL values are sorted at the start regardless of sort order.FALSEFALSE
booleannullsAreSortedHigh​()Retrieves whether NULL values are sorted high.FALSEFALSE
booleannullsAreSortedLow​()Retrieves whether NULL values are sorted low.TRUEFALSE
booleanothersDeletesAreVisible​(int type)Retrieves whether deletes made by others are visible.FALSETRUE
booleanothersInsertsAreVisible​(int type)Retrieves whether inserts made by others are visible.FALSETRUE
booleanothersUpdatesAreVisible​(int type)Retrieves whether updates made by others are visible.FALSETRUE
booleanownDeletesAreVisible​(int type)Retrieves whether a result set's own deletes are visible.FALSETRUE
booleanownInsertsAreVisible​(int type)Retrieves whether a result set's own inserts are visible.FALSETRUE
booleanownUpdatesAreVisible​(int type)Retrieves whether for the given type of ResultSet object, the result set's own updates are visible.FALSETRUE
booleanstoresLowerCaseIdentifiers​()Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in lower case.FALSEFALSE
booleanstoresLowerCaseQuotedIdentifiers​()Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in lower case.FALSEFALSE
booleanstoresMixedCaseIdentifiers​()Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in mixed case.TRUETRUE
booleanstoresMixedCaseQuotedIdentifiers​()Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in mixed case.TRUETRUE
booleanstoresUpperCaseIdentifiers​()Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in upper case.FALSETRUE
booleanstoresUpperCaseQuotedIdentifiers​()Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in upper case.TRUETRUE
booleansupportsAlterTableWithAddColumn​()Retrieves whether this database supports ALTER TABLE with add column.TRUETRUE
booleansupportsAlterTableWithDropColumn​()Retrieves whether this database supports ALTER TABLE with drop column.TRUETRUE
booleansupportsANSI92EntryLevelSQL​()Retrieves whether this database supports the ANSI92 entry level SQL grammar.TRUEFALSE
booleansupportsANSI92FullSQL​()Retrieves whether this database supports the ANSI92 full SQL grammar supported.TRUEFALSE
booleansupportsANSI92IntermediateSQL​()Retrieves whether this database supports the ANSI92 intermediate SQL grammar supported.FALSEFALSE
booleansupportsBatchUpdates​()Retrieves whether this database supports batch updates.TRUETRUE
booleansupportsCatalogsInDataManipulation​()Retrieves whether a catalog name can be used in a data manipulation statement.TRUETRUE
booleansupportsCatalogsInIndexDefinitions​()Retrieves whether a catalog name can be used in an index definition statement.TRUETRUE
booleansupportsCatalogsInPrivilegeDefinitions​()Retrieves whether a catalog name can be used in a privilege definition statement.TRUETRUE
booleansupportsCatalogsInProcedureCalls​()Retrieves whether a catalog name can be used in a procedure call statement.TRUETRUE
booleansupportsCatalogsInTableDefinitions​()Retrieves whether a catalog name can be used in a table definition statement.TRUETRUE
booleansupportsColumnAliasing​()Retrieves whether this database supports column aliasing.TRUETRUE
booleansupportsConvert​()Retrieves whether this database supports the JDBC scalar function CONVERT for the conversion of one JDBC type to another.FALSEFALSE
booleansupportsConvert​(int fromType, int toType)Retrieves whether this database supports the JDBC scalar function CONVERT for conversions between the JDBC types fromType and toType.TRUEFALSE
booleansupportsCoreSQLGrammar​()Retrieves whether this database supports the ODBC Core SQL grammar.TRUEFALSE
booleansupportsCorrelatedSubqueries​()Retrieves whether this database supports correlated subqueries.TRUEFALSE
boolean

supportsDataDefinitionAndData

ManipulationTransactions​()

Retrieves whether this database supports both data definition and data manipulation statements within a transaction.FALSEFALSE
booleansupportsDataManipulationTransactionsOnly​()Retrieves whether this database supports only data manipulation statements within a transaction.FALSETRUE
booleansupportsDifferentTableCorrelationNames​()Retrieves whether, when table correlation names are supported, they are restricted to being different from the names of the tables.TRUEFALSE
booleansupportsExpressionsInOrderBy​()Retrieves whether this database supports expressions in ORDER BY lists.TRUETRUE
booleansupportsExtendedSQLGrammar​()Retrieves whether this database supports the ODBC Extended SQL grammar.FALSEFALSE
booleansupportsFullOuterJoins​()Retrieves whether this database supports full nested outer joins.TRUETRUE
booleansupportsGetGeneratedKeys​()Retrieves whether auto-generated keys can be retrieved after a statement has been executedTRUEFALSE
booleansupportsGroupBy​()Retrieves whether this database supports some form of GROUP BY clause.TRUETRUE
booleansupportsGroupByBeyondSelect​()Retrieves whether this database supports using columns not included in the SELECT statement in a GROUP BY clause provided that all of the columns in the SELECT statement are included in the GROUP BY clause.TRUETRUE
booleansupportsGroupByUnrelated​()Retrieves whether this database supports using a column that is not in the SELECT statement in a GROUP BY clause.TRUETRUE
booleansupportsIntegrityEnhancementFacility​()Retrieves whether this database supports the SQL Integrity Enhancement Facility.FALSEFALSE
booleansupportsLikeEscapeClause​()Retrieves whether this database supports specifying a LIKE escape clause.TRUEFALSE
booleansupportsLimitedOuterJoins​()Retrieves whether this database provides limited support for outer joins.TRUETRUE
booleansupportsMinimumSQLGrammar​()Retrieves whether this database supports the ODBC Minimum SQL grammar.TRUEFALSE
booleansupportsMixedCaseIdentifiers​()Retrieves whether this database treats mixed case unquoted SQL identifiers as case sensitive and as a result stores them in mixed case.TRUETRUE
booleansupportsMixedCaseQuotedIdentifiers​()Retrieves whether this database treats mixed case quoted SQL identifiers as case sensitive and as a result stores them in mixed case.TRUETRUE
booleansupportsMultipleOpenResults​()Retrieves whether it is possible to have multiple ResultSet objects returned from a CallableStatement object simultaneously.TRUEFALSE
booleansupportsMultipleResultSets​()Retrieves whether this database supports getting multiple ResultSet objects from a single call to the method execute.TRUEFALSE
booleansupportsMultipleTransactions​()Retrieves whether this database allows having multiple transactions open at once (on different connections).TRUETRUE
booleansupportsNamedParameters​()Retrieves whether this database supports named parameters to callable statements.FALSEFALSE
booleansupportsNonNullableColumns​()Retrieves whether columns in this database may be defined as non-nullable.TRUEFALSE
booleansupportsOpenCursorsAcrossCommit​()Retrieves whether this database supports keeping cursors open across commits.FALSEFALSE
booleansupportsOpenCursorsAcrossRollback​()Retrieves whether this database supports keeping cursors open across rollbacks.FALSEFALSE
booleansupportsOpenStatementsAcrossCommit​()Retrieves whether this database supports keeping statements open across commits.FALSEFALSE
booleansupportsOpenStatementsAcrossRollback​()Retrieves whether this database supports keeping statements open across rollbacks.FALSEFALSE
booleansupportsOrderByUnrelated​()Retrieves whether this database supports using a column that is not in the SELECT statement in an ORDER BY clause.FALSETRUE
booleansupportsOuterJoins​()Retrieves whether this database supports some form of outer join.TRUETRUE
booleansupportsPositionedDelete​()Retrieves whether this database supports positioned DELETE statements.FALSEFALSE
booleansupportsPositionedUpdate​()Retrieves whether this database supports positioned UPDATE statements.FALSEFALSE
default booleansupportsRefCursors​()Retrieves whether this database supports REF CURSOR.FALSEFALSE
booleansupportsResultSetConcurrency​(int type, int concurrency)Retrieves whether this database supports the given concurrency type in combination with the given result set type.TRUEFALSE
booleansupportsResultSetHoldability​(int holdability)Retrieves whether this database supports the given result set holdability.FALSE返回true
ResultSet的可保持性确定使用commit()Connection接口的方法提交事务(包含上述游标/ ResultSet对象)时是关闭还是保持ResultSet对象(光标)打开。

ResultSet接口提供两个值来指定ResultSet的可保存性,即-

CLOSE_CURSORS_AT_COMMIT:如果ResultSet对象的可保存性设置为此值。每当您使用commit()Connection接口的方法提交/保存事务时,在当前事务中创建的ResultSet对象(已打开)将被关闭。

HOLD_CURSORS_OVER_COMMIT:如果ResultSet对象的可保存性设置为此值。每当使用commit()Connection接口的方法提交/保存事务时,在当前事务中创建的ResultSet对象(已打开)将保持打开状态。
booleansupportsResultSetType​(int type)Retrieves whether this database supports the given result set type.FALSEnext() 返回true,其他返回 false
booleansupportsSavepoints​()Retrieves whether this database supports savepoints.TRUEFALSE
booleansupportsSchemasInDataManipulation​()Retrieves whether a schema name can be used in a data manipulation statement.FALSEFALSE
booleansupportsSchemasInIndexDefinitions​()Retrieves whether a schema name can be used in an index definition statement.FALSEFALSE
booleansupportsSchemasInPrivilegeDefinitions​()Retrieves whether a schema name can be used in a privilege definition statement.FALSEFALSE
booleansupportsSchemasInProcedureCalls​()Retrieves whether a schema name can be used in a procedure call statement.FALSEFALSE
booleansupportsSchemasInTableDefinitions​()Retrieves whether a schema name can be used in a table definition statement.FALSEFALSE
booleansupportsSelectForUpdate​()Retrieves whether this database supports SELECT FOR UPDATE statements.TRUEFALSE
default booleansupportsSharding​()Retrieves whether this database supports sharding.
FALSE
booleansupportsStatementPooling​()Retrieves whether this database supports statement pooling.FALSEFALSE(暂时)
booleansupportsStoredFunctionsUsingCallSyntax​()Retrieves whether this database supports invoking user-defined or vendor functions using the stored procedure escape syntax.TRUEFALSE
booleansupportsStoredProcedures​()Retrieves whether this database supports stored procedure calls that use the stored procedure escape syntax.TRUEFALSE
booleansupportsSubqueriesInComparisons​()Retrieves whether this database supports subqueries in comparison expressions.TRUEFALSE
booleansupportsSubqueriesInExists​()Retrieves whether this database supports subqueries in EXISTS expressions.TRUEFALSE
booleansupportsSubqueriesInIns​()Retrieves whether this database supports subqueries in IN expressions.TRUEFALSE
booleansupportsSubqueriesInQuantifieds​()Retrieves whether this database supports subqueries in quantified expressions.TRUEFALSE
booleansupportsTableCorrelationNames​()Retrieves whether this database supports table correlation names.TRUEFALSE
booleansupportsTransactionIsolationLevel​(int level)Retrieves whether this database supports the given transaction isolation level.传1、2是true,其他falseFALSE
booleansupportsTransactions​()Retrieves whether this database supports transactions.TRUEFALSE
booleansupportsUnion​()Retrieves whether this database supports SQL UNION.TRUEFALSE
booleansupportsUnionAll​()Retrieves whether this database supports SQL UNION ALL.TRUEFALSE
booleanupdatesAreDetected​(int type)Retrieves whether or not a visible row update can be detected by calling the method ResultSet.rowUpdated.FALSEFALSE
booleanusesLocalFilePerTable​()Retrieves whether this database uses a file for each table.FALSEFALSE
booleanusesLocalFiles​()Retrieves whether this database stores tables in a local file.FALSEFALSE
ResultSetMetaDatajava.lang.StringgetCatalogName​(int column)Gets the designated column's table's catalog name.返回数据库名称存储组名字
java.lang.StringgetColumnClassName​(int column)Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column.返回int、float等返回int23,int64,text,boolean、float、double
intgetColumnCount​()Returns the number of columns in this ResultSet object.返回列数返回列数
intgetColumnDisplaySize​(int column)Indicates the designated column's normal maximum width in characters.在数据库中类型的最大字符个数返回integer.maxvaule
java.lang.StringgetColumnLabel​(int column)Gets the designated column's suggested title for use in printouts and displays.列标题(别名)列标题(别名)
java.lang.StringgetColumnName​(int column)Get the designated column's name.列名列名
intgetColumnType​(int column)Retrieves the designated column's SQL type.返回类型如java.lang.String返回类型
java.lang.StringgetColumnTypeName​(int column)Retrieves the designated column's database-specific type name.数据类型名:VARCHAR返回如int32
intgetPrecision​(int column)Get the designated column's specified column size.返回指定列大小如varchar(100)返回100返回指定列大小
intgetScale​(int column)Gets the designated column's number of digits to right of the decimal point.获取小数点右边的指定列的位数例如float(255,2)返回2部分float指定位数,目前无接口,没指定用户java默认
java.lang.StringgetSchemaName​(int column)Get the designated column's table's schema.

模式名称;如果不存在可用的模式名称,

则返回一个空 string,mysql返回空string

存储组名字
java.lang.StringgetTableName​(int column)Gets the designated column's table name.放回表名返回表名
booleanisAutoIncrement​(int column)Indicates whether the designated column is automatically numbered.自增返回true非自增返回falseFALSE
booleanisCaseSensitive​(int column)Indicates whether a column's case matters.FALSETRUE
booleanisCurrency​(int column)Indicates whether the designated column is a cash value.货币性返回true,其他返回falseFALSE
booleanisDefinitelyWritable​(int column)Indicates whether a write on the designated column will definitely succeed.TRUEFALSE
intisNullable​(int column)Indicates the nullability of values in the designated column.为空返回false,非空为trueTRUE
booleanisReadOnly​(int column)Indicates whether the designated column is definitely not writable.FALSETRUE
booleanisSearchable​(int column)Indicates whether the designated column can be used in a where clause.TRUETRUE
booleanisSigned​(int column)Indicates whether values in the designated column are signed numbers.数值型为true,其他为falseTRUE
booleanisWritable​(int column)Indicates whether it is possible for a write on the designated column to succeed.TRUEFALSE
RowSetMetaDatavoidsetAutoIncrement​(int columnIndex, boolean property)Sets whether the designated column is automatically numbered, The default is for a RowSet object's columns not to be automatically numbered.

voidsetCaseSensitive​(int columnIndex, boolean property)Sets whether the designated column is case sensitive.

voidsetCatalogName​(int columnIndex, java.lang.String catalogName)Sets the designated column's table's catalog name, if any, to the given String.

voidsetColumnCount​(int columnCount)Sets the number of columns in the RowSet object to the given number.

voidsetColumnDisplaySize​(int columnIndex, int size)Sets the designated column's normal maximum width in chars to the given int.

voidsetColumnLabel​(int columnIndex, java.lang.String label)Sets the suggested column title for use in printouts and displays, if any, to the given String.

voidsetColumnName​(int columnIndex, java.lang.String columnName)Sets the name of the designated column to the given String.

voidsetColumnType​(int columnIndex, int SQLType)Sets the designated column's SQL type to the one given.

voidsetColumnTypeName​(int columnIndex, java.lang.String typeName)Sets the designated column's type name that is specific to the data source, if any, to the given String.

voidsetCurrency​(int columnIndex, boolean property)Sets whether the designated column is a cash value.

voidsetNullable​(int columnIndex, int property)Sets whether the designated column's value can be set to NULL.

voidsetPrecision​(int columnIndex, int precision)Sets the designated column's number of decimal digits to the given int.

voidsetScale​(int columnIndex, int scale)Sets the designated column's number of digits to the right of the decimal point to the given int.

voidsetSchemaName​(int columnIndex, java.lang.String schemaName)Sets the name of the designated column's table's schema, if any, to the given String.

voidsetSearchable​(int columnIndex, boolean property)Sets whether the designated column can be used in a where clause.

voidsetSigned​(int columnIndex, boolean property)Sets whether the designated column is a signed number.

voidsetTableName​(int columnIndex, java.lang.String tableName)Sets the designated column's table name, if any, to the given String.

ParameterMetaDatajava.lang.StringgetParameterClassName​(int param)Retrieves the fully-qualified name of the Java class whose instances should be passed to the method PreparedStatement.setObject.返回java.lang.Stringstring
intgetParameterCount​()Retrieves the number of parameters in the PreparedStatement object for which this ParameterMetaData object contains information.返回数量返回数量
intgetParameterMode​(int param)Retrieves the designated parameter's mode.1:ParameterMetaData.parameterModeIn, 3:ParameterMetaData.parameterModeOut, or 4:ParameterMetaData.parameterModeInOut 0:ParameterMetaData.parameterModeUnknown1
intgetParameterType​(int param)Retrieves the designated parameter's SQL type.返回12(mysql 不支持)
java.lang.StringgetParameterTypeName​(int param)Retrieves the designated parameter's database-specific type name.返回类型如VARCHAR返回类型
intgetPrecision​(int param)Retrieves the designated parameter's specified column size.00
intgetScale​(int param)Retrieves the designated parameter's number of digits to right of the decimal point.00
intisNullable​(int param)Retrieves whether null values are allowed in the designated parameter.报异常
booleanisSigned​(int param)Retrieves whether values for the designated parameter can be signed numbers.FALSEFALSE
  • No labels