16 package ai.heavy.jdbc;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 import java.sql.DatabaseMetaData;
22 import java.sql.ResultSetMetaData;
23 import java.sql.SQLException;
25 import ai.heavy.thrift.server.TDatumType;
26 import ai.heavy.thrift.server.TQueryResult;
29 final static Logger
logger = LoggerFactory.getLogger(HeavyAIResultSetMetaData.class);
40 return sqlResult.row_set.row_desc.size();
71 return sqlResult.row_set.row_desc.get(column - 1).col_type.nullable
72 ? DatabaseMetaData.columnNullable
73 : DatabaseMetaData.columnNoNulls;
93 return sqlResult.row_set.row_desc.get(column - 1).col_name;
99 return sqlResult.row_set.row_desc.get(column - 1).getCol_name();
104 throws SQLException {
110 throws SQLException {
111 return sqlResult.row_set.row_desc.get(column - 1).col_type.precision;
115 public int getScale(
int column)
throws SQLException {
116 return sqlResult.row_set.row_desc.get(column - 1).col_type.scale;
121 throws SQLException {
122 return "tableName??";
127 throws SQLException {
133 throws SQLException {
134 TDatumType
type = sqlResult.row_set.row_desc.get(column - 1).col_type.type;
141 throws SQLException {
142 return sqlResult.row_set.row_desc.get(column - 1).col_type.type.name();
147 throws SQLException {
153 throws SQLException {
159 throws SQLException {
165 throws SQLException {
166 throw new UnsupportedOperationException(
"Not supported yet,"
167 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
168 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
169 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
174 throws SQLException {
175 throw new UnsupportedOperationException(
"Not supported yet,"
176 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
177 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
178 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
183 throws SQLException {
184 throw new UnsupportedOperationException(
"Not supported yet,"
185 +
" line:" +
new Throwable().getStackTrace()[0].getLineNumber()
186 +
" class:" +
new Throwable().getStackTrace()[0].getClassName()
187 +
" method:" +
new Throwable().getStackTrace()[0].getMethodName());
static int toJava(TDatumType type)