KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > db > jdbc > DatabaseMetaDataImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.db.jdbc;
30
31 import java.sql.Connection JavaDoc;
32 import java.sql.DatabaseMetaData JavaDoc;
33 import java.sql.SQLException JavaDoc;
34 import java.sql.Types JavaDoc;
35
36 class DatabaseMetaDataImpl implements DatabaseMetaData JavaDoc {
37   private Connection JavaDoc _conn;
38   
39   DatabaseMetaDataImpl(Connection JavaDoc conn)
40   {
41     _conn = conn;
42   }
43
44   public java.sql.Connection JavaDoc getConnection()
45   {
46     return _conn;
47   }
48   
49   public String JavaDoc getCatalogTerm()
50   {
51     return "database";
52   }
53
54   /**
55    * Returns the types supported by mysql.
56    */

57   public java.sql.ResultSet JavaDoc getTypeInfo()
58     throws SQLException JavaDoc
59   {
60     DummyResultSet dummy = new DummyResultSet();
61     dummy.addColumn("TYPE_NAME", Types.VARCHAR);
62     dummy.addColumn("DATA_TYPE", Types.SMALLINT);
63     dummy.addColumn("PRECISION", Types.INTEGER);
64     dummy.addColumn("LITERAL_PREFIX", Types.VARCHAR);
65     dummy.addColumn("LITERAL_SUFFIX", Types.VARCHAR);
66     dummy.addColumn("CREATE_PARAMS", Types.VARCHAR);
67     dummy.addColumn("NULLABLE", Types.SMALLINT);
68     dummy.addColumn("CASE_SENSITIVE", Types.BIT);
69     dummy.addColumn("SEARCHABLE", Types.SMALLINT);
70     dummy.addColumn("UNSIGNED_ATTRIBUTE", Types.BIT);
71     dummy.addColumn("FIXED_PREC_SCALE", Types.BIT);
72     dummy.addColumn("AUTO_INCREMENT", Types.BIT);
73     dummy.addColumn("LOCAL_TYPE_NAME", Types.VARCHAR);
74     dummy.addColumn("MINIMUM_SCALE", Types.SMALLINT);
75     dummy.addColumn("MAXIMUM_SCALE", Types.SMALLINT);
76     dummy.addColumn("SQL_DATA_TYPE", Types.INTEGER);
77     dummy.addColumn("SQL_DATETIME_SUB", Types.INTEGER);
78     dummy.addColumn("NUM_PREC_RADIX", Types.INTEGER);
79
80     // boolean
81
dummy.addRow("CHAR:16:1::::1:1:1:1:0:0:CHAR:0:0:1::10");
82     
83     // bit
84
dummy.addRow("TINYINT:-7:1::::1:1:1:1:0:0:TINYINT:0:0:254::10");
85     
86     // byte
87
dummy.addRow("TINYINT:-6:3::::1:0:1:1:0:1:TINYINT:0:0:1::10");
88     
89     // short
90
dummy.addRow("SMALLINT:5:5::::1:0:1:1:0:1:SMALLINT:0:0:2::10");
91     
92     // int
93
dummy.addRow("INTEGER:4:10::::1:0:1:1:0:1:INTEGER:0:0:3::10");
94     
95     // long
96
dummy.addRow("BIGINT:-5:20::::1:0:1:1:0:1:BIGINT:0:0:8::10");
97
98     // float
99
dummy.addRow("FLOAT:6:10:::(M,D) ZEROFILL:1:0:0:1:0:1:FLOAT:3:3:8::10");
100
101     // real
102
dummy.addRow("FLOAT:7:10:::(M,D) ZEROFILL:1:0:0:1:0:1:FLOAT:3:3:8::10");
103     
104     // double
105
dummy.addRow("DOUBLE:8:10:::(M,D) ZEROFILL:1:0:0:1:0:1:FLOAT:3:3:8::10");
106     
107     // char
108
dummy.addRow("CHAR:1:255:':':(M) BINARY:1:1:1:1:0:0:CHAR:0:0:254::10");
109     
110     // varchar
111
dummy.addRow("VARCHAR:12:255:':':(M) BINARY:1:1:1:1:0:0:VARCHAR:0:0:253::10");
112     
113     // timestamp
114
dummy.addRow("DATETIME:93:0:':'::1:1:1:1:0:0:DATETIME:0:0:253::10");
115     
116     // date
117
dummy.addRow("DATETIME:91:0:':'::1:1:1:1:0:0:DATETIME:0:0:253::10");
118     
119     // time
120
dummy.addRow("DATETIME:92:0:':'::1:1:1:1:0:0:DATETIME:0:0:253::10");
121     
122     // numeric
123
dummy.addRow("NUMERIC:2:10:::(M,D) ZEROFILL:1:0:0:0:1:0:NUMERIC:0:20:3::10");
124     dummy.addRow("NUMERIC:3:10:::(M,D) ZEROFILL:1:0:0:0:1:0:NUMERIC:0:20:3::10");
125
126     return dummy;
127   }
128
129   private int typeNameToTypes(String JavaDoc typeName)
130   {
131     int p = typeName.indexOf('(');
132     if (p > 0)
133       typeName = typeName.substring(0, p);
134
135     if ("varchar".equals(typeName))
136       return Types.VARCHAR;
137     else if ("char".equals(typeName))
138       return Types.VARCHAR;
139     else if ("timestamp".equals(typeName))
140       return Types.TIMESTAMP;
141     else if ("tinyint".equals(typeName))
142       return Types.TINYINT;
143     else if ("integer".equals(typeName))
144       return Types.INTEGER;
145     else if ("bigint".equals(typeName))
146       return Types.BIGINT;
147     else if ("double".equals(typeName))
148       return Types.DOUBLE;
149     else
150       return Types.VARCHAR;
151   }
152   public boolean allProceduresAreCallable()
153     throws SQLException JavaDoc
154   {
155     return true;
156   }
157
158   public boolean allTablesAreSelectable()
159     throws SQLException JavaDoc
160   {
161     return true;
162   }
163
164   public String JavaDoc getURL()
165     throws SQLException JavaDoc
166   {
167     return "jdbc:mysql_caucho://localhost:3306/test";
168   }
169   
170   public String JavaDoc getUserName()
171     throws SQLException JavaDoc
172   {
173     return "fergie";
174   }
175
176   public boolean isReadOnly()
177     throws SQLException JavaDoc
178   {
179     return false;
180   }
181
182   public boolean nullsAreSortedHigh()
183     throws SQLException JavaDoc
184   {
185     return false;
186   }
187
188   public boolean nullsAreSortedLow()
189     throws SQLException JavaDoc
190   {
191     return false;
192   }
193
194   public boolean nullsAreSortedAtStart()
195     throws SQLException JavaDoc
196   {
197     return false;
198   }
199
200   public boolean nullsAreSortedAtEnd()
201     throws SQLException JavaDoc
202   {
203     return true;
204   }
205
206   public String JavaDoc getDatabaseProductName()
207     throws SQLException JavaDoc
208   {
209     return "Resin";
210   }
211
212   public String JavaDoc getDatabaseProductVersion()
213     throws SQLException JavaDoc
214   {
215     return "1.1";
216   }
217
218   public String JavaDoc getDriverName()
219     throws SQLException JavaDoc
220   {
221     return "Resin Driver";
222   }
223
224   public String JavaDoc getDriverVersion()
225     throws SQLException JavaDoc
226   {
227     return "1.0";
228   }
229
230   public int getDriverMajorVersion()
231   {
232     return 1;
233   }
234
235   public int getDriverMinorVersion()
236   {
237     return 2;
238   }
239
240   public boolean usesLocalFiles()
241     throws SQLException JavaDoc
242   {
243     return true;
244   }
245
246   public boolean usesLocalFilePerTable()
247     throws SQLException JavaDoc
248   {
249     return true;
250   }
251
252   public boolean supportsMixedCaseIdentifiers()
253     throws SQLException JavaDoc
254   {
255     return true;
256   }
257
258   public boolean storesUpperCaseIdentifiers()
259     throws SQLException JavaDoc
260   {
261     return false;
262   }
263
264   public boolean storesLowerCaseIdentifiers()
265     throws SQLException JavaDoc
266   {
267     return false;
268   }
269
270   public boolean storesMixedCaseIdentifiers()
271     throws SQLException JavaDoc
272   {
273     return true;
274   }
275
276   public boolean supportsMixedCaseQuotedIdentifiers()
277     throws SQLException JavaDoc
278   {
279     return true;
280   }
281
282   public boolean storesUpperCaseQuotedIdentifiers()
283     throws SQLException JavaDoc
284   {
285     return false;
286   }
287
288   public boolean storesLowerCaseQuotedIdentifiers()
289     throws SQLException JavaDoc
290   {
291     return false;
292   }
293
294   public boolean storesMixedCaseQuotedIdentifiers()
295     throws SQLException JavaDoc
296   {
297     return true;
298   }
299
300   public String JavaDoc getIdentifierQuoteString()
301     throws SQLException JavaDoc
302   {
303     return "`";
304   }
305
306   public String JavaDoc getSQLKeywords()
307     throws SQLException JavaDoc
308   {
309     return "";
310   }
311
312   public String JavaDoc getNumericFunctions()
313     throws SQLException JavaDoc
314   {
315     return "";
316   }
317
318   public String JavaDoc getStringFunctions()
319     throws SQLException JavaDoc
320   {
321     return "";
322   }
323
324   public String JavaDoc getSystemFunctions()
325     throws SQLException JavaDoc
326   {
327     return "";
328   }
329
330   public String JavaDoc getTimeDateFunctions()
331     throws SQLException JavaDoc
332   {
333     return "";
334   }
335
336   public String JavaDoc getSearchStringEscape()
337     throws SQLException JavaDoc
338   {
339     return "\\";
340   }
341
342   public String JavaDoc getExtraNameCharacters()
343     throws SQLException JavaDoc
344   {
345     return "";
346   }
347
348   public boolean supportsAlterTableWithAddColumn()
349     throws SQLException JavaDoc
350   {
351     return false;
352   }
353
354   public boolean supportsAlterTableWithDropColumn()
355     throws SQLException JavaDoc
356   {
357     return false;
358   }
359
360   public boolean supportsColumnAliasing()
361     throws SQLException JavaDoc
362   {
363     return true;
364   }
365
366   public boolean nullPlusNonNullIsNull()
367     throws SQLException JavaDoc
368   {
369     return true;
370   }
371
372   public boolean supportsConvert()
373     throws SQLException JavaDoc
374   {
375     return false;
376   }
377
378   public boolean supportsConvert(int fromType, int toType)
379     throws SQLException JavaDoc
380   {
381     return false;
382   }
383
384   public boolean supportsTableCorrelationNames()
385     throws SQLException JavaDoc
386   {
387     return true;
388   }
389
390   public boolean supportsDifferentTableCorrelationNames()
391     throws SQLException JavaDoc
392   {
393     return false;
394   }
395
396   public boolean supportsExpressionsInOrderBy()
397     throws SQLException JavaDoc
398   {
399     return false;
400   }
401
402   public boolean supportsOrderByUnrelated()
403     throws SQLException JavaDoc
404   {
405     return false;
406   }
407
408   public boolean supportsGroupBy()
409     throws SQLException JavaDoc
410   {
411     return false;
412   }
413
414   public boolean supportsGroupByUnrelated()
415     throws SQLException JavaDoc
416   {
417     return false;
418   }
419
420   public boolean supportsGroupByBeyondSelect()
421     throws SQLException JavaDoc
422   {
423     return false;
424   }
425
426   public boolean supportsLikeEscapeClause()
427     throws SQLException JavaDoc
428   {
429     return false;
430   }
431
432   public boolean supportsMultipleResultSets()
433     throws SQLException JavaDoc
434   {
435     return false;
436   }
437
438   public boolean supportsMultipleTransactions()
439     throws SQLException JavaDoc
440   {
441     return false;
442   }
443
444   public boolean supportsNonNullableColumns()
445     throws SQLException JavaDoc
446   {
447     return true;
448   }
449
450   public boolean supportsMinimumSQLGrammar()
451     throws SQLException JavaDoc
452   {
453     return true;
454   }
455
456   public boolean supportsCoreSQLGrammar()
457     throws SQLException JavaDoc
458   {
459     return true;
460   }
461
462   public boolean supportsExtendedSQLGrammar()
463     throws SQLException JavaDoc
464   {
465     return false;
466   }
467
468   public boolean supportsANSI92EntryLevelSQL()
469     throws SQLException JavaDoc
470   {
471     return true;
472   }
473
474   public boolean supportsANSI92IntermediateSQL()
475     throws SQLException JavaDoc
476   {
477     return false;
478   }
479
480   public boolean supportsANSI92FullSQL()
481     throws SQLException JavaDoc
482   {
483     return false;
484   }
485
486   public boolean supportsIntegrityEnhancementFacility()
487     throws SQLException JavaDoc
488   {
489     return false;
490   }
491
492   public boolean supportsOuterJoins()
493     throws SQLException JavaDoc
494   {
495     return false;
496   }
497
498   public boolean supportsFullOuterJoins()
499     throws SQLException JavaDoc
500   {
501     return false;
502   }
503
504   public boolean supportsLimitedOuterJoins()
505     throws SQLException JavaDoc
506   {
507     return false;
508   }
509
510   public String JavaDoc getSchemaTerm()
511     throws SQLException JavaDoc
512   {
513     return "schema";
514   }
515
516   public String JavaDoc getProcedureTerm()
517     throws SQLException JavaDoc
518   {
519     return "procedure";
520   }
521
522   public boolean isCatalogAtStart()
523     throws SQLException JavaDoc
524   {
525     return true;
526   }
527
528   public String JavaDoc getCatalogSeparator()
529     throws SQLException JavaDoc
530   {
531     return ".";
532   }
533
534   public boolean supportsSchemasInDataManipulation()
535     throws SQLException JavaDoc
536   {
537     return false;
538   }
539
540   public boolean supportsSchemasInProcedureCalls()
541     throws SQLException JavaDoc
542   {
543     return false;
544   }
545
546   public boolean supportsSchemasInTableDefinitions()
547     throws SQLException JavaDoc
548   {
549     return false;
550   }
551
552   public boolean supportsSchemasInIndexDefinitions()
553     throws SQLException JavaDoc
554   {
555     return false;
556   }
557
558   public boolean supportsSchemasInPrivilegeDefinitions()
559     throws SQLException JavaDoc
560   {
561     return false;
562   }
563
564   public boolean supportsCatalogsInDataDefinitions()
565     throws SQLException JavaDoc
566   {
567     return false;
568   }
569
570   public boolean supportsCatalogsInProcedureCalls()
571     throws SQLException JavaDoc
572   {
573     return false;
574   }
575
576   public boolean supportsCatalogsInTableDefinitions()
577     throws SQLException JavaDoc
578   {
579     return false;
580   }
581
582   public boolean supportsCatalogsInIndexDefinitions()
583     throws SQLException JavaDoc
584   {
585     return false;
586   }
587
588   public boolean supportsCatalogsInPrivilegeDefinitions()
589     throws SQLException JavaDoc
590   {
591     return false;
592   }
593
594   public boolean supportsPositionedDelete()
595     throws SQLException JavaDoc
596   {
597     return false;
598   }
599
600   public boolean supportsPositionedUpdate()
601     throws SQLException JavaDoc
602   {
603     return false;
604   }
605
606   public boolean supportsSelectForUpdate()
607     throws SQLException JavaDoc
608   {
609     return false;
610   }
611
612   public boolean supportsStoredProcedures()
613     throws SQLException JavaDoc
614   {
615     return false;
616   }
617
618   public boolean supportsSubqueriesInComparisons()
619     throws SQLException JavaDoc
620   {
621     return false;
622   }
623
624   public boolean supportsSubqueriesInExists()
625     throws SQLException JavaDoc
626   {
627     return false;
628   }
629
630   public boolean supportsSubqueriesInIns()
631     throws SQLException JavaDoc
632   {
633     return false;
634   }
635
636   public boolean supportsSubqueriesInQuantifieds()
637     throws SQLException JavaDoc
638   {
639     return false;
640   }
641
642   public boolean supportsCorrelatedSubqueries()
643     throws SQLException JavaDoc
644   {
645     return false;
646   }
647
648   public boolean supportsUnion()
649     throws SQLException JavaDoc
650   {
651     return true;
652   }
653
654   public boolean supportsUnionAll()
655     throws SQLException JavaDoc
656   {
657     return true;
658   }
659
660   public boolean supportsOpenCursorsAcrossCommit()
661     throws SQLException JavaDoc
662   {
663     return false;
664   }
665
666   public boolean supportsOpenCursorsAcrossRollback()
667     throws SQLException JavaDoc
668   {
669     return false;
670   }
671
672   public boolean supportsOpenStatementsAcrossCommit()
673     throws SQLException JavaDoc
674   {
675     return true;
676   }
677
678   public boolean supportsOpenStatementsAcrossRollback()
679     throws SQLException JavaDoc
680   {
681     return true;
682   }
683
684   public int getMaxBinaryLiteralLength()
685     throws SQLException JavaDoc
686   {
687     return 16;
688   }
689
690   public int getMaxCharLiteralLength()
691     throws SQLException JavaDoc
692   {
693     return 254;
694   }
695
696   public int getMaxColumnNameLength()
697     throws SQLException JavaDoc
698   {
699     return 64;
700   }
701
702   public int getMaxColumnsInGroupBy()
703     throws SQLException JavaDoc
704   {
705     return 16;
706   }
707
708   public int getMaxColumnsInIndex()
709     throws SQLException JavaDoc
710   {
711     return 16;
712   }
713
714   public int getMaxColumnsInOrderBy()
715     throws SQLException JavaDoc
716   {
717     return 16;
718   }
719
720   public int getMaxColumnsInSelect()
721     throws SQLException JavaDoc
722   {
723     return 16;
724   }
725
726   public int getMaxColumnsInTable()
727     throws SQLException JavaDoc
728   {
729     return 16;
730   }
731
732   public int getMaxConnections()
733     throws SQLException JavaDoc
734   {
735     return 16;
736   }
737
738   public int getMaxCursorNameLength()
739     throws SQLException JavaDoc
740   {
741     return 254;
742   }
743
744   public int getMaxIndexLength()
745     throws SQLException JavaDoc
746   {
747     return 254;
748   }
749
750   public int getMaxSchemaNameLength()
751     throws SQLException JavaDoc
752   {
753     return 254;
754   }
755
756   public int getMaxProcedureNameLength()
757     throws SQLException JavaDoc
758   {
759     return 254;
760   }
761
762   public int getMaxCatalogNameLength()
763     throws SQLException JavaDoc
764   {
765     return 64;
766   }
767
768   public int getMaxRowSize()
769     throws SQLException JavaDoc
770   {
771     return 65536;
772   }
773
774   public int getMaxRowSizeIncludeBlobs()
775     throws SQLException JavaDoc
776   {
777     return 65536;
778   }
779
780   public boolean doesMaxRowSizeIncludeBlobs()
781     throws SQLException JavaDoc
782   {
783     return false;
784   }
785
786   public int getMaxStatementLength()
787     throws SQLException JavaDoc
788   {
789     return 65536;
790   }
791
792   public int getMaxStatements()
793     throws SQLException JavaDoc
794   {
795     return 0;
796   }
797
798   public int getMaxTableNameLength()
799     throws SQLException JavaDoc
800   {
801     return 64;
802   }
803
804   public int getMaxTablesInSelect()
805     throws SQLException JavaDoc
806   {
807     return 0;
808   }
809
810   public int getMaxUserNameLength()
811     throws SQLException JavaDoc
812   {
813     return 0;
814   }
815
816   public int getDefaultTransactionIsolation()
817     throws SQLException JavaDoc
818   {
819     return Connection.TRANSACTION_NONE;
820   }
821
822   public boolean supportsTransactions()
823     throws SQLException JavaDoc
824   {
825     return true;
826   }
827
828   public boolean supportsTransactionIsolationLevel(int level)
829     throws SQLException JavaDoc
830   {
831     return false;
832   }
833
834   public boolean supportsDataDefinitionAndDataManipulationTransactions()
835     throws SQLException JavaDoc
836   {
837     return false;
838   }
839
840   public boolean supportsDataManipulationTransactionsOnly()
841     throws SQLException JavaDoc
842   {
843     return false;
844   }
845
846   public boolean supportsCatalogsInDataManipulation()
847     throws SQLException JavaDoc
848   {
849     return false;
850   }
851
852   public boolean dataDefinitionCausesTransactionCommit()
853     throws SQLException JavaDoc
854   {
855     return false;
856   }
857
858   public boolean dataDefinitionIgnoredInTransactions()
859     throws SQLException JavaDoc
860   {
861     return false;
862   }
863
864   public java.sql.ResultSet JavaDoc getProcedures(String JavaDoc catalog,
865                                  String JavaDoc schemaPattern,
866                                  String JavaDoc procedureNamePattern)
867     throws SQLException JavaDoc
868   {
869     return null;
870   }
871
872   public java.sql.ResultSet JavaDoc getProcedureColumns(String JavaDoc catalog,
873                                        String JavaDoc schemaPattern,
874                                        String JavaDoc procedureNamePattern,
875                                        String JavaDoc columnNamePatterns)
876     throws SQLException JavaDoc
877   {
878     return null;
879   }
880
881   public java.sql.ResultSet JavaDoc getTables(String JavaDoc catalog,
882                                       String JavaDoc schemaPattern,
883                                       String JavaDoc tableNamePattern,
884                                       String JavaDoc []types)
885     throws SQLException JavaDoc
886   {
887     DummyResultSet dummy = new DummyResultSet();
888
889     dummy.addColumn("TABLE_CAT", Types.VARCHAR);
890     dummy.addColumn("TABLE_SCHEM", Types.VARCHAR);
891     dummy.addColumn("TABLE_NAME", Types.VARCHAR);
892     dummy.addColumn("TABLE_TYPE", Types.VARCHAR);
893     dummy.addColumn("REMARKS", Types.VARCHAR);
894     
895     return dummy;
896   }
897
898   public java.sql.ResultSet JavaDoc getSchemas()
899     throws SQLException JavaDoc
900   {
901     return null;
902   }
903
904   public java.sql.ResultSet JavaDoc getCatalogs()
905     throws SQLException JavaDoc
906   {
907     return null;
908   }
909
910   public java.sql.ResultSet JavaDoc getTableTypes()
911     throws SQLException JavaDoc
912   {
913     return null;
914   }
915
916   public java.sql.ResultSet JavaDoc getColumns(String JavaDoc catalog,
917                               String JavaDoc schemaPattern,
918                               String JavaDoc tableNamePattern,
919                               String JavaDoc columnNamePattern)
920     throws SQLException JavaDoc
921   {
922     DummyResultSet dummy = new DummyResultSet();
923
924     dummy.addColumn("TABLE_CAT", Types.VARCHAR);
925     dummy.addColumn("TABLE_SCHEM", Types.VARCHAR);
926     dummy.addColumn("TABLE_NAME", Types.VARCHAR);
927     dummy.addColumn("COLUMN_NAME", Types.VARCHAR);
928     dummy.addColumn("DATA_TYPE", Types.SMALLINT);
929     dummy.addColumn("TYPE_NAME", Types.VARCHAR);
930     dummy.addColumn("COLUMN_SIZE", Types.INTEGER);
931     dummy.addColumn("BUFFER_LENGTH", Types.INTEGER);
932     dummy.addColumn("DECIMAL_DIGITS", Types.INTEGER);
933     dummy.addColumn("NUM_PREC_RADIX", Types.INTEGER);
934     dummy.addColumn("NULLABLE", Types.INTEGER);
935     dummy.addColumn("REMARKS", Types.VARCHAR);
936     dummy.addColumn("COLUMN_DEF", Types.VARCHAR);
937     dummy.addColumn("SQL_DATA_TYPE", Types.INTEGER);
938     dummy.addColumn("SQL_DATETIME_SUB", Types.INTEGER);
939     dummy.addColumn("CHAR_OCTET_LENGTH", Types.INTEGER);
940     dummy.addColumn("ORDINAL_POSITION", Types.INTEGER);
941     dummy.addColumn("IS_NULLABLE", Types.VARCHAR);
942     
943     return dummy;
944   }
945
946   public java.sql.ResultSet JavaDoc getColumnPrivileges(String JavaDoc catalog,
947                               String JavaDoc schemaPattern,
948                               String JavaDoc tableNamePattern,
949                               String JavaDoc columnNamePattern)
950     throws SQLException JavaDoc
951   {
952     return new DummyResultSet();
953   }
954
955   public java.sql.ResultSet JavaDoc getTable(String JavaDoc catalog,
956                               String JavaDoc schemaPattern,
957                               String JavaDoc tableNamePattern)
958     throws SQLException JavaDoc
959   {
960     return new DummyResultSet();
961   }
962
963   public java.sql.ResultSet JavaDoc getTablePrivileges(String JavaDoc catalog,
964                               String JavaDoc schemaPattern,
965                               String JavaDoc tableNamePattern)
966     throws SQLException JavaDoc
967   {
968     return new DummyResultSet();
969   }
970   
971   public java.sql.ResultSet JavaDoc getBestRowIdentifier(String JavaDoc catalog,
972                                         String JavaDoc schema,
973                                         String JavaDoc table,
974                                         int scope,
975                                         boolean nullable)
976     throws SQLException JavaDoc
977   {
978     return new DummyResultSet();
979   }
980   
981   public java.sql.ResultSet JavaDoc getVersionColumns(String JavaDoc catalog,
982                                      String JavaDoc schema,
983                                      String JavaDoc table)
984     throws SQLException JavaDoc
985   {
986     return new DummyResultSet();
987   }
988   
989   public java.sql.ResultSet JavaDoc getPrimaryKeys(String JavaDoc catalog,
990                                   String JavaDoc schema,
991                                   String JavaDoc table)
992     throws SQLException JavaDoc
993   {
994     return new DummyResultSet();
995   }
996   
997   public java.sql.ResultSet JavaDoc getImportedKeys(String JavaDoc catalog,
998                                    String JavaDoc schema,
999                                    String JavaDoc table)
1000    throws SQLException JavaDoc
1001  {
1002    return new DummyResultSet();
1003  }
1004  
1005  public java.sql.ResultSet JavaDoc getExportedKeys(String JavaDoc catalog,
1006                                   String JavaDoc schema,
1007                                   String JavaDoc table)
1008    throws SQLException JavaDoc
1009  {
1010    return new DummyResultSet();
1011  }
1012  
1013  public java.sql.ResultSet JavaDoc getCrossReference(String JavaDoc primaryCatalog,
1014                                     String JavaDoc primarySchema,
1015                                     String JavaDoc primaryTable,
1016                                     String JavaDoc foreignCatalog,
1017                                     String JavaDoc foreignSchema,
1018                                     String JavaDoc foreignTable)
1019    throws SQLException JavaDoc
1020  {
1021    return new DummyResultSet();
1022  }
1023  
1024  public java.sql.ResultSet JavaDoc getIndexInfo(String JavaDoc catalog,
1025                                String JavaDoc schema,
1026                                String JavaDoc table,
1027                                boolean unique,
1028                                boolean approximate)
1029    throws SQLException JavaDoc
1030  {
1031    return new DummyResultSet();
1032  }
1033  
1034  public boolean supportsResultSetType(int type)
1035    throws SQLException JavaDoc
1036  {
1037    return false;
1038  }
1039  
1040  public boolean supportsResultSetConcurrency(int type, int concurrency)
1041    throws SQLException JavaDoc
1042  {
1043    return false;
1044  }
1045  
1046  public boolean ownUpdatesAreVisible(int type)
1047    throws SQLException JavaDoc
1048  {
1049    return false;
1050  }
1051  
1052  public boolean ownDeletesAreVisible(int type)
1053    throws SQLException JavaDoc
1054  {
1055    return false;
1056  }
1057  
1058  public boolean ownInsertsAreVisible(int type)
1059    throws SQLException JavaDoc
1060  {
1061    return false;
1062  }
1063  
1064  public boolean othersUpdatesAreVisible(int type)
1065    throws SQLException JavaDoc
1066  {
1067    return false;
1068  }
1069  
1070  public boolean othersDeletesAreVisible(int type)
1071    throws SQLException JavaDoc
1072  {
1073    return false;
1074  }
1075  
1076  public boolean othersInsertsAreVisible(int type)
1077    throws SQLException JavaDoc
1078  {
1079    return false;
1080  }
1081  
1082  public boolean updatesAreDetected(int type)
1083    throws SQLException JavaDoc
1084  {
1085    return false;
1086  }
1087  
1088  public boolean deletesAreDetected(int type)
1089    throws SQLException JavaDoc
1090  {
1091    return false;
1092  }
1093  
1094  public boolean insertsAreDetected(int type)
1095    throws SQLException JavaDoc
1096  {
1097    return false;
1098  }
1099  
1100  public boolean supportsBatchUpdates()
1101    throws SQLException JavaDoc
1102  {
1103    return false;
1104  }
1105  
1106  public boolean supportsStatementPooling()
1107    throws SQLException JavaDoc
1108  {
1109    return false;
1110  }
1111  
1112  public boolean supportsUpdateCpy()
1113    throws SQLException JavaDoc
1114  {
1115    return false;
1116  }
1117  
1118  public boolean locatorsUpdateCopy()
1119    throws SQLException JavaDoc
1120  {
1121    return false;
1122  }
1123  
1124  public int getSQLStateType()
1125    throws SQLException JavaDoc
1126  {
1127    return 0;
1128  }
1129  
1130  public int getJDBCMajorVersion()
1131    throws SQLException JavaDoc
1132  {
1133    return 2;
1134  }
1135  
1136  public int getJDBCMinorVersion()
1137    throws SQLException JavaDoc
1138  {
1139    return 0;
1140  }
1141  
1142  public int getResultSetHoldability()
1143    throws SQLException JavaDoc
1144  {
1145    return 0;
1146  }
1147  
1148  public boolean supportsResultSetHoldability()
1149    throws SQLException JavaDoc
1150  {
1151    return false;
1152  }
1153  
1154  public boolean supportsResultSetHoldability(int holdability)
1155    throws SQLException JavaDoc
1156  {
1157    return false;
1158  }
1159  
1160  public java.sql.ResultSet JavaDoc getAttributes(String JavaDoc a, String JavaDoc b, String JavaDoc c, String JavaDoc g)
1161    throws SQLException JavaDoc
1162  {
1163    return null;
1164  }
1165  
1166  public java.sql.ResultSet JavaDoc getSuperTypes(String JavaDoc a, String JavaDoc b, String JavaDoc c)
1167    throws SQLException JavaDoc
1168  {
1169    return null;
1170  }
1171  
1172  public java.sql.ResultSet JavaDoc getSuperTables(String JavaDoc a, String JavaDoc b, String JavaDoc c)
1173    throws SQLException JavaDoc
1174  {
1175    return null;
1176  }
1177  
1178  public boolean supportsGetGeneratedKeys()
1179    throws SQLException JavaDoc
1180  {
1181    return true;
1182  }
1183  
1184  public boolean supportsMultipleOpenResults()
1185    throws SQLException JavaDoc
1186  {
1187    return false;
1188  }
1189  
1190  public boolean supportsNamedParameters()
1191    throws SQLException JavaDoc
1192  {
1193    return false;
1194  }
1195  
1196  public boolean supportsSavepoints()
1197    throws SQLException JavaDoc
1198  {
1199    return false;
1200  }
1201  
1202  public int getDatabaseMajorVersion()
1203    throws SQLException JavaDoc
1204  {
1205    return 0;
1206  }
1207  
1208  public int getDatabaseMinorVersion()
1209    throws SQLException JavaDoc
1210  {
1211    return 0;
1212  }
1213  
1214  public java.sql.ResultSet JavaDoc getUDTs(String JavaDoc catalog,
1215                           String JavaDoc schemaPattern,
1216                           String JavaDoc typeNamePattern,
1217                           int []types)
1218    throws SQLException JavaDoc
1219  {
1220    return null;
1221  }
1222
1223  public String JavaDoc toString()
1224  {
1225    return "DatabaseMetaDataImpl[]";
1226  }
1227}
1228
Popular Tags