2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
8 import java
.sql
.Connection
;
9 import java
.sql
.DatabaseMetaData
;
10 import java
.sql
.ResultSet
;
11 import java
.sql
.RowIdLifetime
;
12 import java
.sql
.SQLException
;
13 import java
.util
.ArrayList
;
19 public class JdbcSqlDatabaseMetaData
extends JSqlError
implements DatabaseMetaData
, JSqlErrorType
22 private boolean isClosed
;
23 private JdbcSqlConnection conn
;
24 private JdbcSqlStatement stmt
;
25 JdbcSqlDatabaseMetaData(JdbcSqlConnection con
)
28 stmt
= new JdbcSqlStatement(con
);
33 public boolean allProceduresAreCallable() throws SQLException
36 throw getException( CSQL_INVALID_STATE
);
40 public boolean allTablesAreSelectable() throws SQLException
43 throw getException(CSQL_INVALID_STATE
);
47 public boolean autoCommitFailureClosesAllResultSets() throws SQLException
50 throw getException( CSQL_INVALID_STATE
);
54 public boolean dataDefinitionCausesTransactionCommit() throws SQLException
57 throw getException( CSQL_INVALID_STATE
);
61 public boolean dataDefinitionIgnoredInTransactions() throws SQLException
64 throw getException( CSQL_INVALID_STATE
);
68 public boolean deletesAreDetected(int type
) throws SQLException
71 throw getException( CSQL_INVALID_STATE
);
74 public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
79 public ResultSet
getAttributes(String catalog
,String schemaPattern
,String typeNamePattern
,String attributeNamePattern
) throws SQLException
81 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
82 FieldInfo
[] fields
= new FieldInfo
[21];
83 fields
[0] = new FieldInfo("", "TYPE_CAT", 30, 32,false);
84 fields
[1] = new FieldInfo("", "TYPE_SCHEM", 30, 32,false);
85 fields
[2] = new FieldInfo("", "TYPE_NAME", 30, 32,true);
86 fields
[3] = new FieldInfo("", "ATTR_NAME", 30, 32,true);
87 fields
[4] = new FieldInfo("", "DATA_TYPE", 3, 32,true);
88 fields
[5] = new FieldInfo("", "ATTR_TYPE_NAME", 30, 32,true);
89 fields
[6] = new FieldInfo("", "ATTR_SIZE", 0, 32,true);
90 fields
[7] = new FieldInfo("", "DECIMAL_DIGITS", 0, 32,true);
91 fields
[8] = new FieldInfo("", "NUM_PREC_RADIX", 0, 32,true);
92 fields
[9] = new FieldInfo("", "NULLABLE ", 0, 32,true);
93 fields
[10] = new FieldInfo("", "REMARKS", 30, 32,true);
94 fields
[11] = new FieldInfo("", "ATTR_DEF", 30, 32,true);
95 fields
[12] = new FieldInfo("", "SQL_DATA_TYPE", 0, 32,true);
96 fields
[13] = new FieldInfo("", "SQL_DATETIME_SUB", 0, 32,true);
97 fields
[14] = new FieldInfo("", "CHAR_OCTET_LENGTH", 0, 32,true);
98 fields
[15] = new FieldInfo("", "ORDINAL_POSITION", 0, 32,true);
99 fields
[16] = new FieldInfo("", "IS_NULLABLE", 30, 32, true);
100 fields
[17] = new FieldInfo("", "SCOPE_CATALOG", 30, 32, true);
101 fields
[18] = new FieldInfo("", "SCOPE_SCHEMA", 30, 32, true);
102 fields
[19] = new FieldInfo("", "SCOPE_TABLE", 30, 32, true);
103 fields
[20] = new FieldInfo("", "SOURCE_DATA_TYPE", 3, 32,true);
104 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
105 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
109 public ResultSet
getBestRowIdentifier(String catalog
, String schema
,String table
,int scope
, boolean nullable
) throws SQLException
111 //TODO: Check with other database
112 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
113 FieldInfo
[] fields
= new FieldInfo
[8];
114 fields
[0] = new FieldInfo("", "SCOPE", 3, 5, true);
115 fields
[1] = new FieldInfo("", "COLUMN_NAME", 30, 32, true);
116 fields
[2] = new FieldInfo("", "DATA_TYPE", 3, 32, true);
117 fields
[3] = new FieldInfo("", "TYPE_NAME", 30, 32, true);
118 fields
[4] = new FieldInfo("", "COLUMN_SIZE", 0, 10, true);
119 fields
[5] = new FieldInfo("", "BUFFER_LENGTH", 0, 10, true);
120 fields
[6] = new FieldInfo("", "DECIMAL_DIGITS", 0, 10, true);
121 fields
[7] = new FieldInfo("", "PSEUDO_COLUMN", 3, 5, true);
122 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
123 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
127 public String
getCatalogSeparator() throws SQLException
132 public String
getCatalogTerm() throws SQLException
138 public ResultSet
getCatalogs() throws SQLException
140 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
141 if(stmt
!=null) stmt
.close();
142 ResultSet rs
= stmt
.executeQuery("getCatalogs");
143 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
147 public ResultSet
getClientInfoProperties() throws SQLException
149 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
150 FieldInfo
[] fields
= new FieldInfo
[4];
151 fields
[0] = new FieldInfo("", "NAME", 30, 64, true);
152 fields
[1] = new FieldInfo("", "MAX_LEN", 0, 4, true);
153 fields
[2] = new FieldInfo("", "DEFAULT_VALUE", 30, 64, true);
154 fields
[3] = new FieldInfo("", "DESCRIPTION", 30, 64, true);
155 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
156 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
161 public ResultSet
getColumnPrivileges(String catalog
, String schema
, String table
, String columnNamePattern
) throws SQLException
163 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
164 FieldInfo
[] fields
= new FieldInfo
[8];
165 fields
[0] = new FieldInfo("", "TABLE_CAT", 30, 64, false);
166 fields
[1] = new FieldInfo("", "TABLE_SCHEM", 30, 64, false);
167 fields
[2] = new FieldInfo("", "TABLE_NAME", 30, 64, true);
168 fields
[3] = new FieldInfo("", "COLUMN_NAME", 30, 64, true);
169 fields
[4] = new FieldInfo("", "GRANTOR", 30, 77, true);
170 fields
[5] = new FieldInfo("", "GRANTEE", 30, 77, true);
171 fields
[6] = new FieldInfo("", "PRIVILEGE", 30, 64, true);
172 fields
[7] = new FieldInfo("", "IS_GRANTABLE", 30, 3, true);
173 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
174 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
178 public ResultSet
getColumns(String catalog
, String schemaPattern
, String tableNamePattern
, String columnNamePattern
) throws SQLException
180 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
181 //conn.setAutoCommit(false);
182 //Statement stmt = conn.createStatement();
183 if(stmt
!=null) stmt
.close();
184 ResultSet rs
= stmt
.executeQuery("describe "+ tableNamePattern
);
185 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
189 public Connection
getConnection() throws SQLException
192 throw getException( CSQL_INVALID_STATE
);
196 public ResultSet
getCrossReference(String parentCatalog
, String parentSchema
, String parentTable
, String foreignCatalog
, String foreignSchema
, String foreignTable
) throws SQLException
199 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
200 FieldInfo
[] fields
= new FieldInfo
[14];
201 fields
[0] = new FieldInfo("", "PKTABLE_CAT", 30, 255, false);
202 fields
[1] = new FieldInfo("", "PKTABLE_SCHEM", 30, 0,false);
203 fields
[2] = new FieldInfo("", "PKTABLE_NAME", 30, 255, true);
204 fields
[3] = new FieldInfo("", "PKCOLUMN_NAME", 30, 32, true);
205 fields
[4] = new FieldInfo("", "FKTABLE_CAT", 30, 255, true);
206 fields
[5] = new FieldInfo("", "FKTABLE_SCHEM", 30, 0, true);
207 fields
[6] = new FieldInfo("", "FKTABLE_NAME", 30, 255, true);
208 fields
[7] = new FieldInfo("", "FKCOLUMN_NAME", 30, 32, true);
209 fields
[8] = new FieldInfo("", "KEY_SEQ", 3, 2, true);
210 fields
[9] = new FieldInfo("", "UPDATE_RULE", 3, 2, true);
211 fields
[10] = new FieldInfo("", "DELETE_RULE", 3, 2, true);
212 fields
[11] = new FieldInfo("", "FK_NAME", 30, 0, true);
213 fields
[12] = new FieldInfo("", "PK_NAME", 30, 0, true);
214 fields
[13] = new FieldInfo("", "DEFERRABILITY", 0, 2, true);
215 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
216 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
220 public int getDatabaseMajorVersion() throws SQLException
225 public int getDatabaseMinorVersion() throws SQLException
230 public String
getDatabaseProductName() throws SQLException
235 public String
getDatabaseProductVersion() throws SQLException
237 return "csql.src.2.6Beta";
240 public int getDefaultTransactionIsolation() throws SQLException
242 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
243 return java
.sql
.Connection
.TRANSACTION_READ_COMMITTED
;
246 public int getDriverMajorVersion()
251 public int getDriverMinorVersion()
256 public String
getDriverName() throws SQLException
258 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
259 return "csql.jdbc.JdbcSqlDriver";
262 public String
getDriverVersion() throws SQLException
264 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
265 return "CSQL JDBC 2.6";
268 public ResultSet
getExportedKeys(String catalog
, String schema
, String table
) throws SQLException
270 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
271 if(stmt
!=null) stmt
.close();
272 ResultSet rs
= stmt
.executeQuery("ExportedKey "+ table
);
273 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
277 public String
getExtraNameCharacters() throws SQLException
282 public ResultSet
getFunctionColumns(String catalog
, String schemaPattern
, String functionNamePattern
, String columnNamePattern
) throws SQLException
284 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
285 FieldInfo
[] fields
= {
286 new FieldInfo("", "FUNCTION_CAT", 30, 64, false),
287 new FieldInfo("", "FUNCTION_SCHEM", 30, 64,false),
288 new FieldInfo("", "FUNCTION_NAME", 30, 64, true),
289 new FieldInfo("", "COLUMN_NAME", 30, 64, true),
290 new FieldInfo("", "COLUMN_TYPE", 30, 64, true),
291 new FieldInfo("", "DATA_TYPE", 3, 4, true),
292 new FieldInfo("", "TYPE_NAME", 30, 64, true),
293 new FieldInfo("", "PRECISION", 3, 4, true),
294 new FieldInfo("", "LENGTH", 3, 4, true),
295 new FieldInfo("", "SCALE", 3, 4, true),
296 new FieldInfo("", "RADIX", 3, 4, true),
297 new FieldInfo("", "NULLABLE", 3, 4, true),
298 new FieldInfo("", "REMARKS", 30, 64, true),
299 new FieldInfo("", "CHAR_OCTET_LENGTH", 3, 64, true),
300 new FieldInfo("", "ORDINAL_POSITION", 3, 64, true),
301 new FieldInfo("", "IS_NULLABLE", 30, 3, true),
302 new FieldInfo("", "SPECIFIC_NAME", 30, 64, true)};
303 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
304 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
308 public ResultSet
getFunctions(String catalog
, String schemaPattern
, String functionNamePattern
) throws SQLException
310 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
311 FieldInfo
[] fields
= new FieldInfo
[6];
312 fields
[0] = new FieldInfo("", "FUNCTION_CAT", 30, 64, false);
313 fields
[1] = new FieldInfo("", "FUNCTION_SCHEM", 30, 64,false);
314 fields
[2] = new FieldInfo("", "FUNCTION_NAME", 30, 64, true);
315 fields
[3] = new FieldInfo("", "REMARKS", 30, 32, true);
316 fields
[4] = new FieldInfo("", "FUNCTION_TYPE", 3, 4, true);
317 fields
[5] = new FieldInfo("", "SPECIFIC_NAME", 30, 64, true);
318 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
319 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
323 public String
getIdentifierQuoteString() throws SQLException
328 public ResultSet
getImportedKeys(String catalog
, String schema
, String table
) throws SQLException
330 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
331 if(stmt
!=null) stmt
.close();
332 ResultSet rs
= stmt
.executeQuery("ImportedKey "+ table
);
333 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
337 public ResultSet
getIndexInfo(String catalog
, String schema
, String table
,boolean unique
, boolean approximate
) throws SQLException
339 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
340 if(stmt
!=null) stmt
.close();
341 ResultSet rs
= stmt
.executeQuery("describe index "+ table
);
342 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
346 public int getJDBCMajorVersion() throws SQLException
351 public int getJDBCMinorVersion() throws SQLException
356 public int getMaxBinaryLiteralLength() throws SQLException
361 public int getMaxCatalogNameLength() throws SQLException
366 public int getMaxCharLiteralLength() throws SQLException
372 public int getMaxColumnNameLength() throws SQLException
377 public int getMaxColumnsInGroupBy() throws SQLException
382 public int getMaxColumnsInIndex() throws SQLException
387 public int getMaxColumnsInOrderBy() throws SQLException
393 public int getMaxColumnsInSelect() throws SQLException
399 public int getMaxColumnsInTable() throws SQLException
404 public int getMaxConnections() throws SQLException
409 public int getMaxCursorNameLength() throws SQLException
414 public int getMaxIndexLength() throws SQLException
419 public int getMaxProcedureNameLength() throws SQLException
424 public int getMaxRowSize() throws SQLException
429 public int getMaxSchemaNameLength() throws SQLException
434 public int getMaxStatementLength() throws SQLException
439 public int getMaxStatements() throws SQLException
444 public int getMaxTableNameLength() throws SQLException
449 public int getMaxTablesInSelect() throws SQLException
454 public int getMaxUserNameLength() throws SQLException
459 public String
getNumericFunctions() throws SQLException
464 public ResultSet
getPrimaryKeys(String catalog
, String schema
, String table
) throws SQLException
466 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
467 if(stmt
!=null) stmt
.close();
468 ResultSet rs
= stmt
.executeQuery("getprimarykey "+ table
);
469 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
474 public ResultSet
getProcedureColumns(String catalog
, String schemaPattern
, String procedureNamePattern
, String columnNamePattern
) throws SQLException
476 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
477 FieldInfo
[] fields
= new FieldInfo
[13];
478 fields
[0] = new FieldInfo("", "PROCEDURE_CAT", 30, 10, false);
479 fields
[1] = new FieldInfo("", "PROCEDURE_SCHEM", 30, 10, false);
480 fields
[2] = new FieldInfo("", "PROCEDURE_NAME", 30, 10, true);
481 fields
[3] = new FieldInfo("", "COLUMN_NAME", 30, 10, true);
482 fields
[4] = new FieldInfo("", "COLUMN_TYPE", 30, 10, true);
483 fields
[5] = new FieldInfo("", "DATA_TYPE", 3, 4, true);
484 fields
[6] = new FieldInfo("", "TYPE_NAME", 30, 10, true);
485 fields
[7] = new FieldInfo("", "PRECISION", 0, 4, true);
486 fields
[8] = new FieldInfo("", "LENGTH", 0, 4, true);
487 fields
[9] = new FieldInfo("", "SCALE", 3, 4, true);
488 fields
[10] = new FieldInfo("", "RADIX", 3, 4, true);
489 fields
[11] = new FieldInfo("", "NULLABLE", 3, 4, true);
490 fields
[12] = new FieldInfo("", "REMARKS", 30, 10, true);
491 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
492 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
496 public String
getProcedureTerm() throws SQLException
501 public ResultSet
getProcedures(String catalog
, String schemaPattern
, String procedureNamePattern
) throws SQLException
503 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
504 FieldInfo
[] fields
= new FieldInfo
[9];
505 fields
[0] = new FieldInfo("", "PROCEDURE_CAT", 30, 255,false);
506 fields
[1] = new FieldInfo("", "PROCEDURE_SCHEM", 30, 255, false);
507 fields
[2] = new FieldInfo("", "PROCEDURE_NAME", 30, 255, true);
508 fields
[3] = new FieldInfo("", "reserved1", 30, 0, true);
509 fields
[4] = new FieldInfo("", "reserved2", 30, 0, true);
510 fields
[5] = new FieldInfo("", "reserved3", 30, 0, true);
511 fields
[6] = new FieldInfo("", "REMARKS", 30, 255, true);
512 fields
[7] = new FieldInfo("", "PROCEDURE_TYPE", 3, 6, true);
513 fields
[8] = new FieldInfo("", "SPECIFIC_NAME", 30, 255, true);
514 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
515 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
519 public int getResultSetHoldability() throws SQLException
521 return ResultSet
.HOLD_CURSORS_OVER_COMMIT
;
525 public RowIdLifetime
getRowIdLifetime() throws SQLException
527 return RowIdLifetime
.ROWID_UNSUPPORTED
;
530 public String
getSQLKeywords() throws SQLException
532 return "SELECT, FROM, AS, WHERE, BETWEEN, IN, AND, OR, NOT, INSERT, INTO, VALUES, DELETE, UPDATE, SET, NULL, CREATE, DROP, TABLE, PRIMARY, INDEX, ON, HASH, TREE, UNIQUE, KEY, DEFAULT, INT, INTEGER, LONG, DOUBLE, REAL, SHORT, SMALLINT, DATE, TIME, TIMESTAMP, BINARY, CHAR, BIGINT, TINYINT, FLOAT, MIN, MAX, SUM, AVG, COUNT, GROUP, ORDER, ASC, DESC, DISTINCT, BY, HAVING, LIMIT, OFFSET, INNER, OUTER, CROSS, LEFT, JOIN, GETALLTABLES, DESCRIBE, GETPRIMARYKEY, AUTO_INCREMENT, SIZE, FOREIGN, REFERENCES, CACHE, UNCACHE, CONDITION, FIELDLIST, PK, DIRECT, DSN, NOSCHEMA, COMPACT, IS, EXPLAIN, PLAN, GETCATALOGS, GETSCHEMAS";
535 public int getSQLStateType() throws SQLException
540 public String
getSchemaTerm() throws SQLException
546 public ResultSet
getSchemas() throws SQLException
548 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
549 FieldInfo
[] fields
= new FieldInfo
[2];
550 fields
[0] = new FieldInfo("", "TABLE_SCHEM", 30, 64,true);
551 fields
[1] = new FieldInfo("", "TABLE_CATALOG", 30, 64, false);
552 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
553 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
558 public ResultSet
getSchemas(String catalog
, String schemaPattern
) throws SQLException
560 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
561 FieldInfo
[] fields
= new FieldInfo
[2];
562 fields
[0] = new FieldInfo("", "TABLE_SCHEM", 30, 64,true);
563 fields
[1] = new FieldInfo("", "TABLE_CATALOG", 30, 64, false);
564 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
565 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
569 public String
getSearchStringEscape() throws SQLException
574 public String
getStringFunctions() throws SQLException
580 public ResultSet
getSuperTables(String catalog
, String schemaPattern
, String tableNamePattern
) throws SQLException
582 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
583 FieldInfo
[] fields
= new FieldInfo
[4];
584 fields
[0] = new FieldInfo("", "TABLE_CAT", 30, 32, false);
585 fields
[1] = new FieldInfo("", "TABLE_SCHEM", 30, 32,false);
586 fields
[2] = new FieldInfo("", "TABLE_NAME", 30, 32, true);
587 fields
[3] = new FieldInfo("", "SUPERTABLE_NAME", 30, 32, true);
588 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
589 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
594 public ResultSet
getSuperTypes(String catalog
, String schemaPattern
, String typeNamePattern
) throws SQLException
596 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
597 FieldInfo
[] fields
= new FieldInfo
[6];
598 fields
[0] = new FieldInfo("", "TABLE_CAT", 30, 32, false);
599 fields
[1] = new FieldInfo("", "TABLE_SCHEM", 30, 32,false);
600 fields
[2] = new FieldInfo("", "TYPE_NAME", 30, 32, true);
601 fields
[3] = new FieldInfo("", "SUPERTYPE_CAT", 30, 32, true);
602 fields
[4] = new FieldInfo("", "SUPERTYPE_SCHEM", 30, 32, true);
603 fields
[5] = new FieldInfo("", "SUPERTYPE_NAME", 30, 32, true);
604 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
605 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
609 public String
getSystemFunctions() throws SQLException
614 public ResultSet
getTablePrivileges(String catalog
, String schemaPattern
, String tableNamePattern
) throws SQLException
616 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
617 FieldInfo
[] fields
= new FieldInfo
[7];
618 fields
[0] = new FieldInfo("", "TABLE_CAT", 30, 64,false);
619 fields
[1] = new FieldInfo("", "TABLE_SCHEM", 30, 1,false);
620 fields
[2] = new FieldInfo("", "TABLE_NAME", 30, 64, true);
621 fields
[3] = new FieldInfo("", "GRANTOR", 30, 77, false);
622 fields
[4] = new FieldInfo("", "GRANTEE", 30, 77, true);
623 fields
[5] = new FieldInfo("", "PRIVILEGE", 30, 64, true);
624 fields
[6] = new FieldInfo("", "IS_GRANTABLE", 30, 3, true);
625 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
626 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
630 public ResultSet
getTableTypes() throws SQLException
633 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
634 if(stmt
!=null) stmt
.close();
635 ResultSet rs
= stmt
.executeQuery("GetTableTypes");
636 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
640 public ResultSet
getTables(String catalog
, String schemaPattern
, String tableNamePattern
, String
[] types
) throws SQLException
642 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
643 //conn.setAutoCommit(false);
644 //Statement stmt = conn.createStatement();
645 if(stmt
!= null) stmt
.close();
646 ResultSet rs
= stmt
.executeQuery("GetAllTables");
647 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
651 public String
getTimeDateFunctions() throws SQLException
656 public ResultSet
getTypeInfo() throws SQLException
658 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
659 if(stmt
!=null) stmt
.close();
660 ResultSet rs
= stmt
.executeQuery("GetDataTypes");
661 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
667 public ResultSet
getUDTs(String catalog
, String schemaPattern
, String typeNamePattern
, int[] types
) throws SQLException
669 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
670 FieldInfo
[] fields
= new FieldInfo
[6];
671 fields
[0] = new FieldInfo("", "TYPE_CAT", 30, 32, false);
672 fields
[1] = new FieldInfo("", "TYPE_SCHEM", 30, 32,false);
673 fields
[2] = new FieldInfo("", "TYPE_NAME", 30, 32, true);
674 fields
[3] = new FieldInfo("", "CLASS_NAME", 30, 32, true);
675 fields
[4] = new FieldInfo("", "DATA_TYPE", 30, 32, true);
676 fields
[5] = new FieldInfo("", "REMARKS", 30, 32, true);
677 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
678 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
683 public String
getURL() throws SQLException
685 return conn
.getUrl();
688 public String
getUserName() throws SQLException
693 public ResultSet
getVersionColumns(String catalog
, String schema
, String table
) throws SQLException
695 if(isClosed
) throw getException(CSQL_INVALID_STATE
);
696 FieldInfo
[] fields
= new FieldInfo
[8];
697 fields
[0] = new FieldInfo("", "SCOPE",3, 5,false);
698 fields
[1] = new FieldInfo("", "COLUMN_NAME", 30, 32, true);
699 fields
[2] = new FieldInfo("", "DATA_TYPE", 3, 5, true);
700 fields
[3] = new FieldInfo("", "TYPE_NAME", 30, 16, true);
701 fields
[4] = new FieldInfo("", "COLUMN_SIZE", 30, 16, true);
702 fields
[5] = new FieldInfo("", "BUFFER_LENGTH", 30, 16, true);
703 fields
[6] = new FieldInfo("", "DECIMAL_DIGITS", 30, 16,false);
704 fields
[7] = new FieldInfo("", "PSEUDO_COLUMN", 3, 5, true);
705 ResultSet rs
= new JdbcSqlResultSet(fields
, null);
706 if(rs
==null){ throw getException(CSQL_INVALID_STATE
);}
711 public boolean insertsAreDetected(int type
) throws SQLException
716 public boolean isCatalogAtStart() throws SQLException
722 public boolean isReadOnly() throws SQLException
727 public boolean locatorsUpdateCopy() throws SQLException
732 public boolean nullPlusNonNullIsNull() throws SQLException
738 public boolean nullsAreSortedAtEnd() throws SQLException
743 public boolean nullsAreSortedAtStart() throws SQLException
748 public boolean nullsAreSortedHigh() throws SQLException
753 public boolean nullsAreSortedLow() throws SQLException
758 public boolean othersDeletesAreVisible(int type
) throws SQLException
763 public boolean othersInsertsAreVisible(int type
) throws SQLException
768 public boolean othersUpdatesAreVisible(int type
) throws SQLException
773 public boolean ownDeletesAreVisible(int type
) throws SQLException
779 public boolean ownInsertsAreVisible(int type
) throws SQLException
784 public boolean ownUpdatesAreVisible(int type
) throws SQLException
790 public boolean storesLowerCaseIdentifiers() throws SQLException
795 public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
800 public boolean storesMixedCaseIdentifiers() throws SQLException
805 public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
810 public boolean storesUpperCaseIdentifiers() throws SQLException
815 public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
821 public boolean supportsANSI92EntryLevelSQL() throws SQLException
826 public boolean supportsANSI92FullSQL() throws SQLException
831 public boolean supportsANSI92IntermediateSQL() throws SQLException
837 public boolean supportsAlterTableWithAddColumn() throws SQLException
842 public boolean supportsAlterTableWithDropColumn() throws SQLException
847 public boolean supportsBatchUpdates() throws SQLException
852 public boolean supportsCatalogsInDataManipulation() throws SQLException
857 public boolean supportsCatalogsInIndexDefinitions() throws SQLException
862 public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
868 public boolean supportsCatalogsInProcedureCalls() throws SQLException
873 public boolean supportsCatalogsInTableDefinitions() throws SQLException
878 public boolean supportsColumnAliasing() throws SQLException
883 public boolean supportsConvert() throws SQLException
888 public boolean supportsConvert(int fromType
,int toType
) throws SQLException
893 public boolean supportsCoreSQLGrammar() throws SQLException
898 public boolean supportsCorrelatedSubqueries() throws SQLException
903 public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
908 public boolean supportsDataManipulationTransactionsOnly() throws SQLException
913 public boolean supportsDifferentTableCorrelationNames() throws SQLException
918 public boolean supportsExpressionsInOrderBy() throws SQLException
923 public boolean supportsExtendedSQLGrammar() throws SQLException
928 public boolean supportsFullOuterJoins() throws SQLException
933 public boolean supportsGetGeneratedKeys() throws SQLException
938 public boolean supportsGroupBy() throws SQLException
943 public boolean supportsGroupByBeyondSelect() throws SQLException
948 public boolean supportsGroupByUnrelated() throws SQLException
953 public boolean supportsIntegrityEnhancementFacility() throws SQLException
955 //TODO: Check for other database
959 public boolean supportsLikeEscapeClause() throws SQLException
964 public boolean supportsLimitedOuterJoins() throws SQLException
969 public boolean supportsMinimumSQLGrammar() throws SQLException
974 public boolean supportsMixedCaseIdentifiers() throws SQLException
979 public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
984 public boolean supportsMultipleOpenResults() throws SQLException
989 public boolean supportsMultipleResultSets() throws SQLException
994 public boolean supportsMultipleTransactions() throws SQLException
999 public boolean supportsNamedParameters() throws SQLException
1004 public boolean supportsNonNullableColumns() throws SQLException
1009 public boolean supportsOpenCursorsAcrossCommit() throws SQLException
1015 public boolean supportsOpenCursorsAcrossRollback() throws SQLException
1020 public boolean supportsOpenStatementsAcrossCommit() throws SQLException
1025 public boolean supportsOpenStatementsAcrossRollback() throws SQLException
1030 public boolean supportsOrderByUnrelated() throws SQLException
1035 public boolean supportsOuterJoins() throws SQLException
1040 public boolean supportsPositionedDelete() throws SQLException
1045 public boolean supportsPositionedUpdate() throws SQLException
1050 public boolean supportsResultSetConcurrency(int type
, int concurrency
) throws SQLException
1054 public boolean supportsResultSetHoldability(int holdability
) throws SQLException
1059 public boolean supportsResultSetType(int type
) throws SQLException
1061 return (type
== ResultSet
.TYPE_FORWARD_ONLY
);
1064 public boolean supportsSavepoints() throws SQLException
1069 public boolean supportsSchemasInDataManipulation() throws SQLException
1074 public boolean supportsSchemasInIndexDefinitions() throws SQLException
1079 public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
1084 public boolean supportsSchemasInProcedureCalls() throws SQLException
1089 public boolean supportsSchemasInTableDefinitions() throws SQLException
1094 public boolean supportsSelectForUpdate() throws SQLException
1099 public boolean supportsStatementPooling() throws SQLException
1104 public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException
1109 public boolean supportsStoredProcedures() throws SQLException
1114 public boolean supportsSubqueriesInComparisons() throws SQLException
1119 public boolean supportsSubqueriesInExists() throws SQLException
1124 public boolean supportsSubqueriesInIns() throws SQLException
1129 public boolean supportsSubqueriesInQuantifieds() throws SQLException
1134 public boolean supportsTableCorrelationNames() throws SQLException
1139 public boolean supportsTransactionIsolationLevel(int level
) throws SQLException
1144 public boolean supportsTransactions() throws SQLException
1149 public boolean supportsUnion() throws SQLException
1153 public boolean supportsUnionAll() throws SQLException
1158 public boolean updatesAreDetected(int type
) throws SQLException
1163 public boolean usesLocalFilePerTable() throws SQLException
1169 public boolean usesLocalFiles() throws SQLException
1174 public boolean isWrapperFor(Class ifact
) throws SQLException
1176 if (JSqlError
.isDebug
) System
.out
.println("DatabaseMetadata::isWrapperFor called");
1177 throw getException(CSQL_NOT_SUPPORTED
);
1179 public Class
unwrap(Class iface
) throws SQLException
1181 if (JSqlError
.isDebug
) System
.out
.println("DatabaseMetadata::unwrap called");
1182 throw getException(CSQL_NOT_SUPPORTED
);