Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
6c5076d7
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6c5076d7
编写于
10月 20, 2017
作者:
H
haocao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add mock result set.
上级
5d894b93
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
522 addition
and
0 deletion
+522
-0
sharding-jdbc-orchestration/src/main/java/io/shardingjdbc/orchestration/jdbc/resultset/MockResultSetMetaData.java
...c/orchestration/jdbc/resultset/MockResultSetMetaData.java
+144
-0
sharding-jdbc-orchestration/src/main/java/io/shardingjdbc/orchestration/jdbc/resultset/MockShardingResultSet.java
...c/orchestration/jdbc/resultset/MockShardingResultSet.java
+378
-0
未找到文件。
sharding-jdbc-orchestration/src/main/java/io/shardingjdbc/orchestration/jdbc/resultset/MockResultSetMetaData.java
0 → 100644
浏览文件 @
6c5076d7
/*
* Copyright 1999-2015 dangdang.com.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
package
io.shardingjdbc.orchestration.jdbc.resultset
;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLException
;
/**
* Mock resultSet metadata.
*
* @author caohao
*/
public
final
class
MockResultSetMetaData
implements
ResultSetMetaData
{
@Override
public
int
getColumnCount
()
throws
SQLException
{
return
0
;
}
@Override
public
boolean
isAutoIncrement
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
isCaseSensitive
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
isSearchable
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
isCurrency
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
int
isNullable
(
final
int
column
)
throws
SQLException
{
return
ResultSetMetaData
.
columnNullable
;
}
@Override
public
boolean
isSigned
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
int
getColumnDisplaySize
(
final
int
column
)
throws
SQLException
{
return
0
;
}
@Override
public
String
getColumnLabel
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
String
getColumnName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
String
getSchemaName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
int
getPrecision
(
final
int
column
)
throws
SQLException
{
return
0
;
}
@Override
public
int
getScale
(
final
int
column
)
throws
SQLException
{
return
0
;
}
@Override
public
String
getTableName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
String
getCatalogName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
int
getColumnType
(
final
int
column
)
throws
SQLException
{
return
0
;
}
@Override
public
String
getColumnTypeName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
boolean
isReadOnly
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
isWritable
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
isDefinitelyWritable
(
final
int
column
)
throws
SQLException
{
return
false
;
}
@Override
public
String
getColumnClassName
(
final
int
column
)
throws
SQLException
{
return
null
;
}
@Override
public
<
T
>
T
unwrap
(
final
Class
<
T
>
iface
)
throws
SQLException
{
return
null
;
}
@Override
public
boolean
isWrapperFor
(
final
Class
<?>
iface
)
throws
SQLException
{
return
false
;
}
}
sharding-jdbc-orchestration/src/main/java/io/shardingjdbc/orchestration/jdbc/resultset/MockShardingResultSet.java
0 → 100644
浏览文件 @
6c5076d7
/*
* Copyright 1999-2015 dangdang.com.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
package
io.shardingjdbc.orchestration.jdbc.resultset
;
import
io.shardingjdbc.core.jdbc.unsupported.AbstractUnsupportedOperationResultSet
;
import
java.io.InputStream
;
import
java.io.Reader
;
import
java.math.BigDecimal
;
import
java.net.URL
;
import
java.sql.Blob
;
import
java.sql.Clob
;
import
java.sql.Date
;
import
java.sql.ResultSet
;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLException
;
import
java.sql.SQLWarning
;
import
java.sql.SQLXML
;
import
java.sql.Statement
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
import
java.util.Calendar
;
/**
* Mock sharding result set.
*
* @author caohao
*/
public
final
class
MockShardingResultSet
extends
AbstractUnsupportedOperationResultSet
{
@Override
public
boolean
next
()
throws
SQLException
{
return
false
;
}
@Override
public
void
close
()
throws
SQLException
{
}
@Override
public
boolean
wasNull
()
throws
SQLException
{
return
true
;
}
@Override
public
String
getString
(
final
int
columnIndex
)
throws
SQLException
{
return
""
;
}
@Override
public
String
getString
(
final
String
columnLabel
)
throws
SQLException
{
return
""
;
}
@Override
public
boolean
getBoolean
(
final
int
columnIndex
)
throws
SQLException
{
return
false
;
}
@Override
public
boolean
getBoolean
(
final
String
columnLabel
)
throws
SQLException
{
return
false
;
}
@Override
public
byte
getByte
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
byte
getByte
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
short
getShort
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
short
getShort
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
int
getInt
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
int
getInt
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
long
getLong
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
long
getLong
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
float
getFloat
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
float
getFloat
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
double
getDouble
(
final
int
columnIndex
)
throws
SQLException
{
return
0
;
}
@Override
public
double
getDouble
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
byte
[]
getBytes
(
final
int
columnIndex
)
throws
SQLException
{
return
new
byte
[
0
];
}
@Override
public
byte
[]
getBytes
(
final
String
columnLabel
)
throws
SQLException
{
return
new
byte
[
0
];
}
@Override
public
Date
getDate
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Date
getDate
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
Date
getDate
(
final
int
columnIndex
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
Date
getDate
(
final
String
columnLabel
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
Time
getTime
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Time
getTime
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
Time
getTime
(
final
int
columnIndex
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
Time
getTime
(
final
String
columnLabel
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
Timestamp
getTimestamp
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Timestamp
getTimestamp
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
Timestamp
getTimestamp
(
final
int
columnIndex
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
Timestamp
getTimestamp
(
final
String
columnLabel
,
final
Calendar
cal
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getAsciiStream
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getAsciiStream
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getUnicodeStream
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getUnicodeStream
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getBinaryStream
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
InputStream
getBinaryStream
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
SQLWarning
getWarnings
()
throws
SQLException
{
return
null
;
}
@Override
public
void
clearWarnings
()
throws
SQLException
{
}
@Override
public
ResultSetMetaData
getMetaData
()
throws
SQLException
{
return
new
MockResultSetMetaData
();
}
@Override
public
Object
getObject
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Object
getObject
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
int
findColumn
(
final
String
columnLabel
)
throws
SQLException
{
return
0
;
}
@Override
public
Reader
getCharacterStream
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Reader
getCharacterStream
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
BigDecimal
getBigDecimal
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
BigDecimal
getBigDecimal
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
BigDecimal
getBigDecimal
(
final
int
columnIndex
,
final
int
scale
)
throws
SQLException
{
return
null
;
}
@Override
public
BigDecimal
getBigDecimal
(
final
String
columnLabel
,
final
int
scale
)
throws
SQLException
{
return
null
;
}
@Override
public
void
setFetchDirection
(
final
int
direction
)
throws
SQLException
{
}
@Override
public
int
getFetchDirection
()
throws
SQLException
{
return
ResultSet
.
FETCH_FORWARD
;
}
@Override
public
void
setFetchSize
(
final
int
rows
)
throws
SQLException
{
}
@Override
public
int
getFetchSize
()
throws
SQLException
{
return
0
;
}
@Override
public
int
getType
()
throws
SQLException
{
return
ResultSet
.
TYPE_FORWARD_ONLY
;
}
@Override
public
int
getConcurrency
()
throws
SQLException
{
return
ResultSet
.
CONCUR_READ_ONLY
;
}
@Override
public
Statement
getStatement
()
throws
SQLException
{
return
null
;
}
@Override
public
Blob
getBlob
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Blob
getBlob
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
Clob
getClob
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
Clob
getClob
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
URL
getURL
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
URL
getURL
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
@Override
public
boolean
isClosed
()
throws
SQLException
{
return
false
;
}
@Override
public
SQLXML
getSQLXML
(
final
int
columnIndex
)
throws
SQLException
{
return
null
;
}
@Override
public
SQLXML
getSQLXML
(
final
String
columnLabel
)
throws
SQLException
{
return
null
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录