1 22 23 28 package com.sqlmagic.tinysql; 29 30 51 import java.sql.SQLException ; 52 import java.sql.Connection ; 53 import java.sql.ResultSet ; 54 import java.sql.Types ; 55 56 public class tinySQLDatabaseMetaData implements java.sql.DatabaseMetaData { 57 58 63 private Connection connection = null; 64 65 public tinySQLDatabaseMetaData(Connection connection) { 66 this.connection = connection; 67 } 68 69 72 79 public boolean allProceduresAreCallable() { 80 return false; 81 } 82 83 90 public boolean allTablesAreSelectable() { 91 return true; 92 } 93 94 100 public String getURL() { 101 return ""; } 103 104 110 public String getUserName() { 111 return ""; 112 } 113 114 120 public boolean isReadOnly() { 121 return false; 122 } 123 124 130 public boolean nullsAreSortedHigh() { 131 return false; 132 } 133 134 140 public boolean nullsAreSortedLow() { 141 return !nullsAreSortedHigh(); 142 } 143 144 150 public boolean nullsAreSortedAtStart() { 151 return false; 152 } 153 154 160 public boolean nullsAreSortedAtEnd() { 161 return !nullsAreSortedAtStart(); 162 } 163 164 170 public String getDatabaseProductName() { 171 return "tinySQL"; 172 } 173 174 180 public String getDatabaseProductVersion() { 181 return "dBase III"; 182 } 183 184 190 public String getDriverName() { 191 return "com.sqlmagic.tinysql.dbfFileDriver"; 192 } 193 194 200 public String getDriverVersion() { 201 return "0.71 Alpha"; 202 } 203 204 209 public int getDriverMajorVersion() { 210 return 0; 211 } 212 213 218 public int getDriverMinorVersion() { 219 return 7; 220 } 221 222 228 public boolean usesLocalFiles() { 229 return true; 230 } 231 232 238 public boolean usesLocalFilePerTable() { 239 return true; 240 } 241 242 251 public boolean supportsMixedCaseIdentifiers() { 252 return false; 253 } 254 255 262 public boolean storesUpperCaseIdentifiers() { 263 return true; 264 } 265 266 273 public boolean storesLowerCaseIdentifiers() { 274 return !storesUpperCaseIdentifiers(); 275 } 276 277 284 public boolean storesMixedCaseIdentifiers() { 285 return supportsMixedCaseIdentifiers(); 286 } 287 288 297 public boolean supportsMixedCaseQuotedIdentifiers() { 298 return supportsMixedCaseIdentifiers(); 299 } 300 301 308 public boolean storesUpperCaseQuotedIdentifiers() { 309 return true; 310 } 311 312 319 public boolean storesLowerCaseQuotedIdentifiers() { 320 return !storesUpperCaseQuotedIdentifiers(); 321 } 322 323 330 public boolean storesMixedCaseQuotedIdentifiers() { 331 return supportsMixedCaseIdentifiers(); 332 } 333 334 344 public String getIdentifierQuoteString() { 345 return "\""; } 347 348 355 public String getSQLKeywords() { 356 return ""; 357 } 358 359 367 public String getNumericFunctions() { 368 return ""; 369 } 370 371 379 public String getStringFunctions() { 380 return ""; 381 } 382 383 391 public String getSystemFunctions() { 392 return ""; 393 } 394 395 401 public String getTimeDateFunctions() { 402 return ""; 403 } 404 405 417 public String getSearchStringEscape() { 418 return "\\"; 419 } 420 421 428 public String getExtraNameCharacters() { 429 return ""; 430 } 431 432 435 441 public boolean supportsAlterTableWithAddColumn() { 442 return true; } 444 445 451 public boolean supportsAlterTableWithDropColumn() { 452 return true; } 454 455 467 public boolean supportsColumnAliasing() { 468 return false; 469 } 470 471 479 public boolean nullPlusNonNullIsNull() { 480 return true; 481 } 482 483 489 public boolean supportsConvert() { 490 return false; 491 } 492 493 502 public boolean supportsConvert(int fromType, int toType) { 503 return false; 504 } 505 506 514 public boolean supportsTableCorrelationNames() { 515 return false; 516 } 517 518 525 public boolean supportsDifferentTableCorrelationNames() { 526 return false; 527 } 528 529 535 public boolean supportsExpressionsInOrderBy() { 536 return false; 537 } 538 539 545 public boolean supportsOrderByUnrelated() { 546 return false; 547 } 548 549 555 public boolean supportsGroupBy() { 556 return false; 557 } 558 559 565 public boolean supportsGroupByUnrelated() { 566 return false; 567 } 568 569 576 public boolean supportsGroupByBeyondSelect() { 577 return false; 578 } 579 580 588 public boolean supportsLikeEscapeClause() { 589 return false; 590 } 591 592 598 public boolean supportsMultipleResultSets() { 599 return false; 600 } 601 602 609 public boolean supportsMultipleTransactions() { 610 return false; 611 } 612 613 621 public boolean supportsNonNullableColumns() { 622 return false; 623 } 624 625 633 public boolean supportsMinimumSQLGrammar() { 634 return false; 635 } 636 637 643 public boolean supportsCoreSQLGrammar() { 644 return false; 645 } 646 647 653 public boolean supportsExtendedSQLGrammar() { 654 return false; 655 } 656 657 665 public boolean supportsANSI92EntryLevelSQL() { 666 return false; 667 } 668 669 675 public boolean supportsANSI92IntermediateSQL() { 676 return false; 677 } 678 679 685 public boolean supportsANSI92FullSQL() { 686 return false; 687 } 688 689 695 public boolean supportsIntegrityEnhancementFacility() { 696 return false; 697 } 698 699 705 public boolean supportsOuterJoins() { 706 return false; 707 } 708 709 715 public boolean supportsFullOuterJoins() { 716 return false; 717 } 718 719 726 public boolean supportsLimitedOuterJoins() { 727 return false; 728 } 729 730 736 public String getSchemaTerm() throws SQLException { 737 throw new SQLException ("tinySQL does not support schema term."); 738 } 739 740 746 public String getProcedureTerm() throws SQLException { 747 throw new SQLException ("tinySQL does not support procedure."); 748 } 749 750 756 public String getCatalogTerm() throws SQLException { 757 throw new SQLException ("tinySQL does not support catalog."); 758 } 759 760 767 public boolean isCatalogAtStart() { 768 return false; 769 } 770 771 777 public String getCatalogSeparator() throws SQLException { 778 throw new SQLException ("tinySQL does not catalog."); 779 } 780 781 787 public boolean supportsSchemasInDataManipulation() { 788 return false; 789 } 790 791 797 public boolean supportsSchemasInProcedureCalls() { 798 return false; 799 } 800 801 807 public boolean supportsSchemasInTableDefinitions() { 808 return false; 809 } 810 811 817 public boolean supportsSchemasInIndexDefinitions() { 818 return false; 819 } 820 821 827 public boolean supportsSchemasInPrivilegeDefinitions() { 828 return false; 829 } 830 831 837 public boolean supportsCatalogsInDataManipulation() { 838 return false; 839 } 840 841 847 public boolean supportsCatalogsInProcedureCalls() { 848 return false; 849 } 850 851 857 public boolean supportsCatalogsInTableDefinitions() { 858 return false; 859 } 860 861 867 public boolean supportsCatalogsInIndexDefinitions() { 868 return false; 869 } 870 871 877 public boolean supportsCatalogsInPrivilegeDefinitions() { 878 return false; 879 } 880 881 882 888 public boolean supportsPositionedDelete() { 889 return false; 890 } 891 892 898 public boolean supportsPositionedUpdate() { 899 return false; 900 } 901 902 908 public boolean supportsSelectForUpdate() { 909 return false; 910 } 911 912 919 public boolean supportsStoredProcedures() { 920 return false; 921 } 922 923 931 public boolean supportsSubqueriesInComparisons() { 932 return false; 933 } 934 935 943 public boolean supportsSubqueriesInExists() { 944 return false; 945 } 946 947 955 public boolean supportsSubqueriesInIns() { 956 return false; 957 } 958 959 967 public boolean supportsSubqueriesInQuantifieds() { 968 return false; 969 } 970 971 979 public boolean supportsCorrelatedSubqueries() { 980 return false; 981 } 982 983 989 public boolean supportsUnion() { 990 return false; 991 } 992 993 999 public boolean supportsUnionAll() { 1000 return false; 1001 } 1002 1003 1010 public boolean supportsOpenCursorsAcrossCommit() { 1011 return false; 1012 } 1013 1014 1021 public boolean supportsOpenCursorsAcrossRollback() { 1022 return false; 1023 } 1024 1025 1032 public boolean supportsOpenStatementsAcrossCommit() { 1033 return false; 1034 } 1035 1036 1043 public boolean supportsOpenStatementsAcrossRollback() { 1044 return false; 1045 } 1046 1047 1048 1049 1055 1062 public int getMaxBinaryLiteralLength() { 1063 return 0; 1064 } 1065 1066 1073 public int getMaxCharLiteralLength() { 1074 return 0; 1075 } 1076 1077 1084 public int getMaxColumnNameLength() { 1085 return 10; 1086 } 1087 1088 1095 public int getMaxColumnsInGroupBy() { 1096 return 0; 1097 } 1098 1099 1106 public int getMaxColumnsInIndex() { 1107 return 0; 1108 } 1109 1110 1117 public int getMaxColumnsInOrderBy() { 1118 return 0; 1119 } 1120 1121 1128 public int getMaxColumnsInSelect() { 1129 return 10000; } 1131 1132 1139 public int getMaxColumnsInTable() { 1140 return 10000; } 1142 1143 1150 public int getMaxConnections() { 1151 return 1; } 1153 1154 1161 public int getMaxCursorNameLength() { 1162 return 0; 1163 } 1164 1165 1172 public int getMaxIndexLength() { 1173 return 0; 1174 } 1175 1176 1183 public int getMaxSchemaNameLength() { 1184 return 0; 1185 } 1186 1187 1194 public int getMaxProcedureNameLength() { 1195 return 0; 1196 } 1197 1198 1205 public int getMaxCatalogNameLength() { 1206 return 0; 1207 } 1208 1209 1216 public int getMaxRowSize() { 1217 return 0; 1218 } 1221 1222 1229 public boolean doesMaxRowSizeIncludeBlobs() { 1230 return false; 1231 } 1232 1233 1240 public int getMaxStatementLength() { 1241 return 0; 1242 } 1243 1244 1252 public int getMaxStatements() { 1253 return 10; } 1255 1256 1263 public int getMaxTableNameLength() { 1264 return 32; } 1266 1267 1274 public int getMaxTablesInSelect() { 1275 return 1; } 1277 1278 1285 public int getMaxUserNameLength() { 1286 return 0; 1287 } 1288 1289 1291 1299 public int getDefaultTransactionIsolation() throws SQLException { 1300 throw new SQLException ("tinySQL does not support transaction isolation."); 1301 } 1302 1303 1311 public boolean supportsTransactions() { 1312 return false; 1313 } 1314 1315 1323 public boolean supportsTransactionIsolationLevel(int level) { 1324 return false; 1325 } 1326 1327 1334 public boolean supportsDataDefinitionAndDataManipulationTransactions(){ 1335 return false; 1336 } 1337 1344 public boolean supportsDataManipulationTransactionsOnly(){ 1345 return false; 1346 } 1347 1354 public boolean dataDefinitionCausesTransactionCommit(){ 1355 return false; 1356 } 1357 1363 public boolean dataDefinitionIgnoredInTransactions() throws SQLException { 1364 throw new SQLException ("tinySQL does not support transactions."); 1365 } 1366 1367 1368 1402 public ResultSet getProcedures(String catalog, String schemaPattern, 1403 String procedureNamePattern) { 1404 return null; 1405 } 1406 1407 1414 int procedureResultUnknown = 0; 1415 1416 1423 int procedureNoResult = 1; 1424 1425 1432 int procedureReturnsResult = 2; 1433 1434 1491 public ResultSet getProcedureColumns(String catalog, 1492 String schemaPattern, 1493 String procedureNamePattern, 1494 String columnNamePattern) { 1495 return null; 1496 } 1497 1498 1505 int procedureColumnUnknown = 0; 1506 1507 1514 int procedureColumnIn = 1; 1515 1516 1523 int procedureColumnInOut = 2; 1524 1525 1532 int procedureColumnOut = 4; 1533 1540 int procedureColumnReturn = 5; 1541 1542 1549 int procedureColumnResult = 3; 1550 1551 1558 int procedureNoNulls = 0; 1559 1560 1567 int procedureNullable = 1; 1568 1569 1577 int procedureNullableUnknown = 2; 1578 1579 1580 1611 public ResultSet getTables(String catalog, String schemaPattern, 1612 String tableNamePattern, String types[]) { 1613 return null; } 1615 1616 1629 public ResultSet getSchemas() throws SQLException { 1630 throw new SQLException ("tinySQL does not support schemas."); 1631 } 1632 1633 1646 public ResultSet getCatalogs() throws SQLException { 1647 throw new SQLException ("tinySQL does not support catalogues."); 1648 } 1649 1650 1665 public ResultSet getTableTypes() { 1666 return null; } 1668 1669 1721 public ResultSet getColumns(String catalog, String schemaPattern, 1722 String tableNamePattern, String columnNamePattern) { 1723 Utils.log("tinySQL does not support getColumns()."); 1724 return null; 1725 } 1726 1733 int columnNoNulls = 0; 1734 1735 1742 int columnNullable = 1; 1743 1744 1751 int columnNullableUnknown = 2; 1752 1753 1782 public ResultSet getColumnPrivileges(String catalog, String schema, 1783 String table, String columnNamePattern) throws SQLException { 1784 throw new SQLException ("tinySQL does not support column privileges."); 1785 } 1786 1787 1820 public ResultSet getTablePrivileges(String catalog, String schemaPattern, 1821 String tableNamePattern) throws SQLException { 1822 throw new SQLException ("tinySQL does not support table privileges."); 1823 } 1824 1825 1862 public ResultSet getBestRowIdentifier(String catalog, String schema, 1863 String table, int scope, boolean nullable) throws SQLException { 1864 throw new SQLException ("tinySQL does not support best row identifiers."); 1865 } 1866 1867 1876 int bestRowTemporary = 0; 1877 1878 1886 int bestRowTransaction = 1; 1887 1888 1896 int bestRowSession = 2; 1897 1898 1905 int bestRowUnknown = 0; 1906 1907 1914 int bestRowNotPseudo = 1; 1915 1916 1923 int bestRowPseudo = 2; 1924 1925 1955 public ResultSet getVersionColumns(String catalog, String schema, 1956 String table)throws SQLException { 1957 throw new SQLException ("tinySQL does not support version columns."); 1958 } 1959 1960 1967 int versionColumnUnknown = 0; 1968 1969 1976 int versionColumnNotPseudo = 1; 1977 1978 1985 int versionColumnPseudo = 2; 1986 1987 2009 public ResultSet getPrimaryKeys(String catalog, String schema, 2010 String table) throws SQLException { 2011 throw new SQLException ("tinySQL does not support primary keys."); 2012 } 2013 2014 2082 public ResultSet getImportedKeys(String catalog, String schema, 2083 String table) throws SQLException { 2084 throw new SQLException ("tinySQL does not support imported keys."); 2085 } 2086 2087 2102 int importedKeyCascade = 0; 2103 2104 2117 int importedKeyRestrict = 1; 2118 2119 2131 int importedKeySetNull = 2; 2132 2133 2144 int importedKeyNoAction = 3; 2145 2146 2158 int importedKeySetDefault = 4; 2159 2160 2168 int importedKeyInitiallyDeferred = 5; 2169 2170 2178 int importedKeyInitiallyImmediate = 6; 2179 2180 2188 int importedKeyNotDeferrable = 7; 2189 2190 2258 public ResultSet getExportedKeys(String catalog, String schema, 2259 String table) throws SQLException { 2260 throw new SQLException ("tinySQL does not support exported keys."); 2261 } 2262 2263 2339 public ResultSet getCrossReference( 2340 String primaryCatalog, String primarySchema, String primaryTable, 2341 String foreignCatalog, String foreignSchema, String foreignTable 2342 ) throws SQLException { 2343 throw new SQLException ("tinySQL does not support cross reference."); 2344 } 2345 2346 2392 public ResultSet getTypeInfo() throws SQLException { 2393 throw new SQLException ("tinySQL getTypeInfo not yet implemented."); 2394 } 2395 2396 2403 int typeNoNulls = 0; 2404 2405 2412 int typeNullable = 1; 2413 2414 2421 int typeNullableUnknown = 2; 2422 2423 2430 int typePredNone = 0; 2431 2432 2439 int typePredChar = 1; 2440 2441 2448 int typePredBasic = 2; 2449 2450 2457 int typeSearchable = 3; 2458 2459 2511 public ResultSet getIndexInfo(String catalog, String schema, String table, 2512 boolean unique, boolean approximate) throws SQLException { 2513 throw new SQLException ("tinySQL does not support index infos."); 2514 } 2515 2516 2523 short tableIndexStatistic = 0; 2524 2525 2531 short tableIndexClustered = 1; 2532 2533 2539 short tableIndexHashed = 2; 2540 2541 2549 short tableIndexOther = 3; 2550 2551 2553 2563 public boolean supportsResultSetType(int type) { 2564 return false; 2565 } 2566 2567 2579 public boolean supportsResultSetConcurrency(int type, int concurrency){ 2580 return false; 2581 } 2582 2583 2593 public boolean ownUpdatesAreVisible(int type) { 2594 return false; 2595 } 2596 2597 2607 public boolean ownDeletesAreVisible(int type) { 2608 return false; 2609 } 2610 2620 public boolean ownInsertsAreVisible(int type) { 2621 return false; 2622 } 2623 2624 2635 public boolean othersUpdatesAreVisible(int type) { 2636 return false; 2637 } 2638 2639 2650 public boolean othersDeletesAreVisible(int type) { 2651 return false; 2652 } 2653 2665 public boolean othersInsertsAreVisible(int type) { 2666 return false; 2667 } 2668 2669 2680 public boolean updatesAreDetected(int type) { 2681 return false; 2682 } 2683 2684 2695 public boolean deletesAreDetected(int type) { 2696 return false; 2697 } 2698 2699 2709 public boolean insertsAreDetected(int type) { 2710 return false; 2711 } 2712 2713 2719 public boolean supportsBatchUpdates() { 2720 return false; 2721 } 2722 2723 2761 public ResultSet getUDTs(String catalog, String schemaPattern, 2762 String typeNamePattern, int[] types) throws SQLException { 2763 throw new SQLException ("tinySQL does not support getUDTs."); 2764 } 2765 2766 2772 public Connection getConnection() { 2773 return connection; 2774 } 2775} 2776 2777 2778 2779 | Popular Tags |