Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
00bc3617
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
00bc3617
编写于
1月 16, 2021
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change
上级
bbd9fdc6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
247 deletion
+0
-247
src/connector/jdbc/src/test/java/com/taosdata/jdbc/DatabaseMetaDataTest.java
...src/test/java/com/taosdata/jdbc/DatabaseMetaDataTest.java
+0
-247
未找到文件。
src/connector/jdbc/src/test/java/com/taosdata/jdbc/DatabaseMetaDataTest.java
已删除
100644 → 0
浏览文件 @
bbd9fdc6
package
com.taosdata.jdbc
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
java.sql.*
;
import
java.util.Properties
;
public
class
DatabaseMetaDataTest
{
static
Connection
connection
=
null
;
static
PreparedStatement
statement
=
null
;
static
String
dbName
=
"test"
;
static
String
tName
=
"t0"
;
static
String
host
=
"localhost"
;
@BeforeClass
public
static
void
createConnection
()
throws
SQLException
{
try
{
Class
.
forName
(
"com.taosdata.jdbc.TSDBDriver"
);
}
catch
(
ClassNotFoundException
e
)
{
return
;
}
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_HOST
,
host
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_USER
,
"root"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_PASSWORD
,
"taosdata"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_CHARSET
,
"UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_LOCALE
,
"en_US.UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_TIME_ZONE
,
"UTC-8"
);
connection
=
DriverManager
.
getConnection
(
"jdbc:TAOS://"
+
host
+
":0/"
,
properties
);
String
sql
=
"drop database if exists "
+
dbName
;
statement
=
connection
.
prepareStatement
(
sql
);
statement
.
executeUpdate
(
"create database if not exists "
+
dbName
);
statement
.
executeUpdate
(
"create table if not exists "
+
dbName
+
"."
+
tName
+
" (ts timestamp, k int, v int)"
);
}
@Test
public
void
testMetaDataTest
()
throws
SQLException
{
DatabaseMetaData
databaseMetaData
=
connection
.
getMetaData
();
ResultSet
resultSet
=
databaseMetaData
.
getTables
(
dbName
,
"t*"
,
"t*"
,
new
String
[]{
"t"
});
while
(
resultSet
.
next
())
{
for
(
int
i
=
1
;
i
<=
resultSet
.
getMetaData
().
getColumnCount
();
i
++)
{
System
.
out
.
printf
(
"%d: %s\n"
,
i
,
resultSet
.
getString
(
i
));
}
}
resultSet
.
close
();
databaseMetaData
.
isWrapperFor
(
null
);
databaseMetaData
.
allProceduresAreCallable
();
databaseMetaData
.
allTablesAreSelectable
();
databaseMetaData
.
getURL
();
databaseMetaData
.
getUserName
();
databaseMetaData
.
isReadOnly
();
databaseMetaData
.
nullsAreSortedHigh
();
databaseMetaData
.
nullsAreSortedLow
();
databaseMetaData
.
nullsAreSortedAtStart
();
databaseMetaData
.
nullsAreSortedAtEnd
();
databaseMetaData
.
getDatabaseProductName
();
databaseMetaData
.
getDatabaseProductVersion
();
databaseMetaData
.
getDriverName
();
databaseMetaData
.
getDriverVersion
();
databaseMetaData
.
getDriverMajorVersion
();
databaseMetaData
.
getDriverMinorVersion
();
databaseMetaData
.
usesLocalFiles
();
databaseMetaData
.
usesLocalFilePerTable
();
databaseMetaData
.
supportsMixedCaseIdentifiers
();
databaseMetaData
.
storesUpperCaseIdentifiers
();
databaseMetaData
.
storesLowerCaseIdentifiers
();
databaseMetaData
.
storesMixedCaseIdentifiers
();
databaseMetaData
.
supportsMixedCaseQuotedIdentifiers
();
databaseMetaData
.
storesUpperCaseQuotedIdentifiers
();
databaseMetaData
.
storesLowerCaseQuotedIdentifiers
();
databaseMetaData
.
storesMixedCaseQuotedIdentifiers
();
databaseMetaData
.
getIdentifierQuoteString
();
databaseMetaData
.
getSQLKeywords
();
databaseMetaData
.
getNumericFunctions
();
databaseMetaData
.
getStringFunctions
();
databaseMetaData
.
getSystemFunctions
();
databaseMetaData
.
getTimeDateFunctions
();
databaseMetaData
.
getSearchStringEscape
();
databaseMetaData
.
getExtraNameCharacters
();
databaseMetaData
.
supportsAlterTableWithAddColumn
();
databaseMetaData
.
supportsAlterTableWithDropColumn
();
databaseMetaData
.
supportsColumnAliasing
();
databaseMetaData
.
nullPlusNonNullIsNull
();
databaseMetaData
.
supportsConvert
();
databaseMetaData
.
supportsConvert
(
0
,
0
);
databaseMetaData
.
supportsTableCorrelationNames
();
databaseMetaData
.
supportsDifferentTableCorrelationNames
();
databaseMetaData
.
supportsExpressionsInOrderBy
();
databaseMetaData
.
supportsOrderByUnrelated
();
databaseMetaData
.
supportsGroupBy
();
databaseMetaData
.
supportsGroupByUnrelated
();
databaseMetaData
.
supportsGroupByBeyondSelect
();
databaseMetaData
.
supportsLikeEscapeClause
();
databaseMetaData
.
supportsMultipleResultSets
();
databaseMetaData
.
supportsMultipleTransactions
();
databaseMetaData
.
supportsNonNullableColumns
();
databaseMetaData
.
supportsMinimumSQLGrammar
();
databaseMetaData
.
supportsCoreSQLGrammar
();
databaseMetaData
.
supportsExtendedSQLGrammar
();
databaseMetaData
.
supportsANSI92EntryLevelSQL
();
databaseMetaData
.
supportsANSI92IntermediateSQL
();
databaseMetaData
.
supportsANSI92FullSQL
();
databaseMetaData
.
supportsIntegrityEnhancementFacility
();
databaseMetaData
.
supportsOuterJoins
();
databaseMetaData
.
supportsFullOuterJoins
();
databaseMetaData
.
supportsLimitedOuterJoins
();
databaseMetaData
.
getSchemaTerm
();
databaseMetaData
.
getProcedureTerm
();
databaseMetaData
.
getCatalogTerm
();
databaseMetaData
.
isCatalogAtStart
();
databaseMetaData
.
getCatalogSeparator
();
databaseMetaData
.
supportsSchemasInDataManipulation
();
databaseMetaData
.
supportsSchemasInProcedureCalls
();
databaseMetaData
.
supportsSchemasInTableDefinitions
();
databaseMetaData
.
supportsSchemasInIndexDefinitions
();
databaseMetaData
.
supportsSchemasInPrivilegeDefinitions
();
databaseMetaData
.
supportsCatalogsInDataManipulation
();
databaseMetaData
.
supportsCatalogsInProcedureCalls
();
databaseMetaData
.
supportsCatalogsInTableDefinitions
();
databaseMetaData
.
supportsCatalogsInIndexDefinitions
();
databaseMetaData
.
supportsCatalogsInPrivilegeDefinitions
();
databaseMetaData
.
supportsPositionedDelete
();
databaseMetaData
.
supportsPositionedUpdate
();
databaseMetaData
.
supportsSelectForUpdate
();
databaseMetaData
.
supportsStoredProcedures
();
databaseMetaData
.
supportsSubqueriesInComparisons
();
databaseMetaData
.
supportsSubqueriesInExists
();
databaseMetaData
.
supportsSubqueriesInIns
();
databaseMetaData
.
supportsSubqueriesInQuantifieds
();
databaseMetaData
.
supportsCorrelatedSubqueries
();
databaseMetaData
.
supportsUnion
();
databaseMetaData
.
supportsUnionAll
();
databaseMetaData
.
supportsOpenCursorsAcrossCommit
();
databaseMetaData
.
supportsOpenCursorsAcrossRollback
();
databaseMetaData
.
supportsOpenStatementsAcrossCommit
();
databaseMetaData
.
supportsOpenStatementsAcrossRollback
();
databaseMetaData
.
getMaxBinaryLiteralLength
();
databaseMetaData
.
getMaxCharLiteralLength
();
databaseMetaData
.
getMaxColumnNameLength
();
databaseMetaData
.
getMaxColumnsInGroupBy
();
databaseMetaData
.
getMaxColumnsInIndex
();
databaseMetaData
.
getMaxColumnsInOrderBy
();
databaseMetaData
.
getMaxColumnsInSelect
();
databaseMetaData
.
getMaxColumnsInTable
();
databaseMetaData
.
getMaxConnections
();
databaseMetaData
.
getMaxCursorNameLength
();
databaseMetaData
.
getMaxIndexLength
();
databaseMetaData
.
getMaxSchemaNameLength
();
databaseMetaData
.
getMaxProcedureNameLength
();
databaseMetaData
.
getMaxCatalogNameLength
();
databaseMetaData
.
getMaxRowSize
();
databaseMetaData
.
doesMaxRowSizeIncludeBlobs
();
databaseMetaData
.
getMaxStatementLength
();
databaseMetaData
.
getMaxStatements
();
databaseMetaData
.
getMaxTableNameLength
();
databaseMetaData
.
getMaxTablesInSelect
();
databaseMetaData
.
getMaxUserNameLength
();
databaseMetaData
.
getDefaultTransactionIsolation
();
databaseMetaData
.
supportsTransactions
();
databaseMetaData
.
supportsTransactionIsolationLevel
(
0
);
databaseMetaData
.
supportsDataDefinitionAndDataManipulationTransactions
();
databaseMetaData
.
supportsDataManipulationTransactionsOnly
();
databaseMetaData
.
dataDefinitionCausesTransactionCommit
();
databaseMetaData
.
dataDefinitionIgnoredInTransactions
();
try
{
databaseMetaData
.
getProcedures
(
""
,
""
,
""
);
}
catch
(
Exception
e
)
{
}
try
{
databaseMetaData
.
getProcedureColumns
(
""
,
""
,
""
,
""
);
}
catch
(
Exception
e
)
{
}
try
{
databaseMetaData
.
getTables
(
""
,
""
,
""
,
new
String
[]{
""
});
}
catch
(
Exception
e
)
{
}
databaseMetaData
.
getSchemas
();
databaseMetaData
.
getCatalogs
();
// databaseMetaData.getTableTypes();
databaseMetaData
.
getColumns
(
dbName
,
""
,
tName
,
""
);
databaseMetaData
.
getColumnPrivileges
(
""
,
""
,
""
,
""
);
databaseMetaData
.
getTablePrivileges
(
""
,
""
,
""
);
databaseMetaData
.
getBestRowIdentifier
(
""
,
""
,
""
,
0
,
false
);
databaseMetaData
.
getVersionColumns
(
""
,
""
,
""
);
databaseMetaData
.
getPrimaryKeys
(
""
,
""
,
""
);
databaseMetaData
.
getImportedKeys
(
""
,
""
,
""
);
databaseMetaData
.
getExportedKeys
(
""
,
""
,
""
);
databaseMetaData
.
getCrossReference
(
""
,
""
,
""
,
""
,
""
,
""
);
databaseMetaData
.
getTypeInfo
();
databaseMetaData
.
getIndexInfo
(
""
,
""
,
""
,
false
,
false
);
databaseMetaData
.
supportsResultSetType
(
0
);
databaseMetaData
.
supportsResultSetConcurrency
(
0
,
0
);
databaseMetaData
.
ownUpdatesAreVisible
(
0
);
databaseMetaData
.
ownDeletesAreVisible
(
0
);
databaseMetaData
.
ownInsertsAreVisible
(
0
);
databaseMetaData
.
othersUpdatesAreVisible
(
0
);
databaseMetaData
.
othersDeletesAreVisible
(
0
);
databaseMetaData
.
othersInsertsAreVisible
(
0
);
databaseMetaData
.
updatesAreDetected
(
0
);
databaseMetaData
.
deletesAreDetected
(
0
);
databaseMetaData
.
insertsAreDetected
(
0
);
databaseMetaData
.
supportsBatchUpdates
();
databaseMetaData
.
getUDTs
(
""
,
""
,
""
,
new
int
[]{
0
});
databaseMetaData
.
getConnection
();
databaseMetaData
.
supportsSavepoints
();
databaseMetaData
.
supportsNamedParameters
();
databaseMetaData
.
supportsMultipleOpenResults
();
databaseMetaData
.
supportsGetGeneratedKeys
();
databaseMetaData
.
getSuperTypes
(
""
,
""
,
""
);
databaseMetaData
.
getSuperTables
(
""
,
""
,
""
);
databaseMetaData
.
getAttributes
(
""
,
""
,
""
,
""
);
databaseMetaData
.
supportsResultSetHoldability
(
0
);
databaseMetaData
.
getResultSetHoldability
();
databaseMetaData
.
getDatabaseMajorVersion
();
databaseMetaData
.
getDatabaseMinorVersion
();
databaseMetaData
.
getJDBCMajorVersion
();
databaseMetaData
.
getJDBCMinorVersion
();
databaseMetaData
.
getSQLStateType
();
databaseMetaData
.
locatorsUpdateCopy
();
databaseMetaData
.
supportsStatementPooling
();
databaseMetaData
.
getRowIdLifetime
();
databaseMetaData
.
getSchemas
(
""
,
""
);
databaseMetaData
.
supportsStoredFunctionsUsingCallSyntax
();
databaseMetaData
.
autoCommitFailureClosesAllResultSets
();
databaseMetaData
.
getClientInfoProperties
();
databaseMetaData
.
getFunctions
(
""
,
""
,
""
);
databaseMetaData
.
getFunctionColumns
(
""
,
""
,
""
,
""
);
databaseMetaData
.
getPseudoColumns
(
""
,
""
,
""
,
""
);
databaseMetaData
.
generatedKeyAlwaysReturned
();
}
@AfterClass
public
static
void
close
()
throws
Exception
{
statement
.
executeUpdate
(
"drop database "
+
dbName
);
statement
.
close
();
connection
.
close
();
Thread
.
sleep
(
10
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录