~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ikvm/openjdk/sun/jdbc/odbc/JdbcOdbcDatabaseMetaData.java

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (C) 2009, 2011 Volker Berlin (i-net software)
 
3
 
 
4
  This software is provided 'as-is', without any express or implied
 
5
  warranty.  In no event will the authors be held liable for any damages
 
6
  arising from the use of this software.
 
7
 
 
8
  Permission is granted to anyone to use this software for any purpose,
 
9
  including commercial applications, and to alter it and redistribute it
 
10
  freely, subject to the following restrictions:
 
11
 
 
12
  1. The origin of this software must not be misrepresented; you must not
 
13
     claim that you wrote the original software. If you use this software
 
14
     in a product, an acknowledgment in the product documentation would be
 
15
     appreciated but is not required.
 
16
  2. Altered source versions must be plainly marked as such, and must not be
 
17
     misrepresented as being the original software.
 
18
  3. This notice may not be removed or altered from any source distribution.
 
19
 
 
20
  Jeroen Frijters
 
21
  jeroen@frijters.net
 
22
  
 
23
 */
 
24
package sun.jdbc.odbc;
 
25
 
 
26
import ikvm.lang.CIL;
 
27
 
 
28
import java.sql.*;
 
29
import java.util.HashSet;
 
30
 
 
31
import cli.System.Data.*;
 
32
import cli.System.Data.Common.*;
 
33
import cli.System.Data.Odbc.*;
 
34
 
 
35
/**
 
36
 * @author Volker Berlin
 
37
 */
 
38
public class JdbcOdbcDatabaseMetaData implements DatabaseMetaData{
 
39
 
 
40
    private JdbcOdbcConnection jdbcConn;
 
41
 
 
42
    private final OdbcConnection netConn;
 
43
 
 
44
    private DataRow dataSourceInfo;
 
45
 
 
46
    public JdbcOdbcDatabaseMetaData(JdbcOdbcConnection jdbcConn, OdbcConnection netConn){
 
47
        this.jdbcConn = jdbcConn;
 
48
        this.netConn = netConn;
 
49
    }
 
50
 
 
51
 
 
52
    public boolean allProceduresAreCallable() throws SQLException{
 
53
        // TODO Auto-generated method stub
 
54
        return false;
 
55
    }
 
56
 
 
57
 
 
58
    public boolean allTablesAreSelectable() throws SQLException{
 
59
        // TODO Auto-generated method stub
 
60
        return false;
 
61
    }
 
62
 
 
63
 
 
64
    public boolean autoCommitFailureClosesAllResultSets(){
 
65
        throw new UnsupportedOperationException();
 
66
    }
 
67
 
 
68
 
 
69
    public boolean dataDefinitionCausesTransactionCommit() throws SQLException{
 
70
        // TODO Auto-generated method stub
 
71
        return false;
 
72
    }
 
73
 
 
74
 
 
75
    public boolean dataDefinitionIgnoredInTransactions() throws SQLException{
 
76
        // TODO Auto-generated method stub
 
77
        return false;
 
78
    }
 
79
 
 
80
 
 
81
    public boolean deletesAreDetected(int type) throws SQLException{
 
82
        // TODO Auto-generated method stub
 
83
        return false;
 
84
    }
 
85
 
 
86
 
 
87
    public boolean doesMaxRowSizeIncludeBlobs() throws SQLException{
 
88
        // TODO Auto-generated method stub
 
89
        return false;
 
90
    }
 
91
 
 
92
 
 
93
    public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern,
 
94
            String attributeNamePattern){
 
95
        throw new UnsupportedOperationException();
 
96
    }
 
97
 
 
98
 
 
99
    public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)
 
100
            throws SQLException{
 
101
        // TODO Auto-generated method stub
 
102
        return null;
 
103
    }
 
104
 
 
105
 
 
106
    public String getCatalogSeparator() throws SQLException{
 
107
        // TODO Auto-generated method stub
 
108
        return null;
 
109
    }
 
110
 
 
111
 
 
112
    public String getCatalogTerm() throws SQLException{
 
113
        // TODO Auto-generated method stub
 
114
        return null;
 
115
    }
 
116
 
 
117
 
 
118
    public ResultSet getCatalogs() throws SQLException{
 
119
        // TODO Auto-generated method stub
 
120
        return null;
 
121
    }
 
122
 
 
123
 
 
124
    public ResultSet getClientInfoProperties(){
 
125
        throw new UnsupportedOperationException();
 
126
    }
 
127
 
 
128
 
 
129
    public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern)
 
130
            throws SQLException{
 
131
        // TODO Auto-generated method stub
 
132
        return null;
 
133
    }
 
134
 
 
135
 
 
136
    public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
 
137
            throws SQLException{
 
138
        try{
 
139
            // the description of the restrictions can you request with GetSchema("Restrictions")
 
140
            String[] restrictions = new String[]{catalog, schemaPattern, tableNamePattern, columnNamePattern};
 
141
            DataTable data = netConn.GetSchema(OdbcMetaDataCollectionNames.Columns, restrictions);
 
142
            return new JdbcOdbcDTResultSet(data);
 
143
        }catch(Throwable th){
 
144
            throw JdbcOdbcUtils.createSQLException(th);
 
145
        }
 
146
    }
 
147
 
 
148
 
 
149
    public Connection getConnection(){
 
150
        return jdbcConn;
 
151
    }
 
152
 
 
153
 
 
154
    public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable,
 
155
            String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException{
 
156
        // TODO Auto-generated method stub
 
157
        return null;
 
158
    }
 
159
 
 
160
 
 
161
    public int getDatabaseMajorVersion(){
 
162
        String version = netConn.get_ServerVersion().trim();
 
163
        for(int i = 0; i < version.length(); i++){
 
164
            char ch = version.charAt(i);
 
165
            if(ch < '0' || ch > '9'){
 
166
                return Integer.parseInt(version.substring(0, i));
 
167
            }
 
168
        }
 
169
        return Integer.parseInt(version);
 
170
    }
 
171
 
 
172
 
 
173
    public int getDatabaseMinorVersion(){
 
174
        String version = netConn.get_ServerVersion().trim();
 
175
        int idx = version.indexOf('.');
 
176
        if(idx < 0){
 
177
            return 0;
 
178
        }
 
179
        version = version.substring(idx + 1);
 
180
        for(int i = 0; i < version.length(); i++){
 
181
            char ch = version.charAt(i);
 
182
            if(ch < '0' || ch > '9'){
 
183
                return Integer.parseInt(version.substring(0, i));
 
184
            }
 
185
        }
 
186
        return Integer.parseInt(version);
 
187
    }
 
188
 
 
189
 
 
190
    public String getDatabaseProductName() throws SQLException{
 
191
        return String.valueOf(getInfo(DbMetaDataColumnNames.DataSourceProductName));
 
192
    }
 
193
 
 
194
 
 
195
    public String getDatabaseProductVersion(){
 
196
        return netConn.get_ServerVersion();
 
197
    }
 
198
 
 
199
 
 
200
    public int getDefaultTransactionIsolation(){
 
201
        return Connection.TRANSACTION_READ_COMMITTED;
 
202
    }
 
203
 
 
204
 
 
205
    public int getDriverMajorVersion(){
 
206
        return 2;
 
207
    }
 
208
 
 
209
 
 
210
    public int getDriverMinorVersion(){
 
211
        return 1;
 
212
    }
 
213
 
 
214
 
 
215
    public String getDriverName(){
 
216
        return "JDBC-ODBC Bridge (" + netConn.get_Driver() + ")";
 
217
    }
 
218
 
 
219
 
 
220
    public String getDriverVersion(){
 
221
        return "2.0001";
 
222
    }
 
223
 
 
224
 
 
225
    public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException{
 
226
        // TODO Auto-generated method stub
 
227
        return null;
 
228
    }
 
229
 
 
230
 
 
231
    public String getExtraNameCharacters(){
 
232
        return "";
 
233
    }
 
234
 
 
235
 
 
236
    public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern,
 
237
            String columnNamePattern){
 
238
        throw new UnsupportedOperationException();
 
239
    }
 
240
 
 
241
 
 
242
    public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern){
 
243
        throw new UnsupportedOperationException();
 
244
    }
 
245
 
 
246
 
 
247
    public String getIdentifierQuoteString() throws SQLException{
 
248
        String quote = (String)getInfo(DbMetaDataColumnNames.QuotedIdentifierPattern);
 
249
        if(quote.length()>=2){
 
250
            char ch1 = quote.charAt(0);
 
251
            char ch2 = quote.charAt(quote.length()-1);
 
252
            if(ch1 == ch2){
 
253
                return quote.substring(0,1);
 
254
            }
 
255
        }
 
256
        return "\""; // ANSI SQL and should work with the most DBMS
 
257
    }
 
258
 
 
259
 
 
260
    public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException{
 
261
        // TODO Auto-generated method stub
 
262
        return null;
 
263
    }
 
264
 
 
265
 
 
266
    public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)
 
267
            throws SQLException{
 
268
        try{
 
269
            // the description of the restrictions can you request with GetSchema("Restrictions")
 
270
            String[] restrictions = new String[]{catalog, schema, table};
 
271
            DataTable data = netConn.GetSchema(OdbcMetaDataCollectionNames.Indexes, restrictions);
 
272
            return new JdbcOdbcDTResultSet(data);
 
273
        }catch(Throwable th){
 
274
            throw JdbcOdbcUtils.createSQLException(th);
 
275
        }
 
276
    }
 
277
 
 
278
 
 
279
    public int getJDBCMajorVersion(){
 
280
        return 2;
 
281
    }
 
282
 
 
283
 
 
284
    public int getJDBCMinorVersion(){
 
285
        return 0;
 
286
    }
 
287
 
 
288
 
 
289
    public int getMaxBinaryLiteralLength() throws SQLException{
 
290
        // TODO Auto-generated method stub
 
291
        return 0;
 
292
    }
 
293
 
 
294
 
 
295
    public int getMaxCatalogNameLength() throws SQLException{
 
296
        // TODO Auto-generated method stub
 
297
        return 0;
 
298
    }
 
299
 
 
300
 
 
301
    public int getMaxCharLiteralLength() throws SQLException{
 
302
        // TODO Auto-generated method stub
 
303
        return 0;
 
304
    }
 
305
 
 
306
 
 
307
    public int getMaxColumnNameLength() throws SQLException{
 
308
        // TODO Auto-generated method stub
 
309
        return 0;
 
310
    }
 
311
 
 
312
 
 
313
    public int getMaxColumnsInGroupBy() throws SQLException{
 
314
        // TODO Auto-generated method stub
 
315
        return 0;
 
316
    }
 
317
 
 
318
 
 
319
    public int getMaxColumnsInIndex() throws SQLException{
 
320
        // TODO Auto-generated method stub
 
321
        return 0;
 
322
    }
 
323
 
 
324
 
 
325
    public int getMaxColumnsInOrderBy() throws SQLException{
 
326
        // TODO Auto-generated method stub
 
327
        return 0;
 
328
    }
 
329
 
 
330
 
 
331
    public int getMaxColumnsInSelect() throws SQLException{
 
332
        // TODO Auto-generated method stub
 
333
        return 0;
 
334
    }
 
335
 
 
336
 
 
337
    public int getMaxColumnsInTable() throws SQLException{
 
338
        // TODO Auto-generated method stub
 
339
        return 0;
 
340
    }
 
341
 
 
342
 
 
343
    public int getMaxConnections() throws SQLException{
 
344
        // TODO Auto-generated method stub
 
345
        return 0;
 
346
    }
 
347
 
 
348
 
 
349
    public int getMaxCursorNameLength() throws SQLException{
 
350
        // TODO Auto-generated method stub
 
351
        return 0;
 
352
    }
 
353
 
 
354
 
 
355
    public int getMaxIndexLength() throws SQLException{
 
356
        // TODO Auto-generated method stub
 
357
        return 0;
 
358
    }
 
359
 
 
360
 
 
361
    public int getMaxProcedureNameLength() throws SQLException{
 
362
        // TODO Auto-generated method stub
 
363
        return 0;
 
364
    }
 
365
 
 
366
 
 
367
    public int getMaxRowSize() throws SQLException{
 
368
        // TODO Auto-generated method stub
 
369
        return 0;
 
370
    }
 
371
 
 
372
 
 
373
    public int getMaxSchemaNameLength() throws SQLException{
 
374
        // TODO Auto-generated method stub
 
375
        return 0;
 
376
    }
 
377
 
 
378
 
 
379
    public int getMaxStatementLength() throws SQLException{
 
380
        // TODO Auto-generated method stub
 
381
        return 0;
 
382
    }
 
383
 
 
384
 
 
385
    public int getMaxStatements() throws SQLException{
 
386
        // TODO Auto-generated method stub
 
387
        return 0;
 
388
    }
 
389
 
 
390
 
 
391
    public int getMaxTableNameLength() throws SQLException{
 
392
        // TODO Auto-generated method stub
 
393
        return 0;
 
394
    }
 
395
 
 
396
 
 
397
    public int getMaxTablesInSelect() throws SQLException{
 
398
        // TODO Auto-generated method stub
 
399
        return 0;
 
400
    }
 
401
 
 
402
 
 
403
    public int getMaxUserNameLength() throws SQLException{
 
404
        // TODO Auto-generated method stub
 
405
        return 0;
 
406
    }
 
407
 
 
408
 
 
409
    public String getNumericFunctions() throws SQLException{
 
410
        // TODO Auto-generated method stub
 
411
        return null;
 
412
    }
 
413
 
 
414
 
 
415
    public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException{
 
416
        // TODO Auto-generated method stub
 
417
        return null;
 
418
    }
 
419
 
 
420
 
 
421
    public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern,
 
422
            String columnNamePattern) throws SQLException{
 
423
        try{
 
424
            // the description of the restrictions can you request with GetSchema("Restrictions")
 
425
            String[] restrictions = new String[]{catalog, schemaPattern, procedureNamePattern, columnNamePattern};
 
426
            DataTable dt1 = netConn.GetSchema(OdbcMetaDataCollectionNames.ProcedureColumns, restrictions);
 
427
            DataTable dt2 = netConn.GetSchema(OdbcMetaDataCollectionNames.ProcedureParameters, restrictions);
 
428
            // concatenate the both DataTable
 
429
            DataRowCollection rows1 = dt1.get_Rows();
 
430
            DataRowCollection rows2 = dt2.get_Rows();
 
431
            for(int i = 0; i < rows2.get_Count(); i++){
 
432
                DataRow row = rows2.get_Item(i);
 
433
                rows1.Add(row.get_ItemArray());
 
434
            }
 
435
            return new JdbcOdbcDTResultSet(dt1);
 
436
        }catch(Throwable th){
 
437
            throw JdbcOdbcUtils.createSQLException(th);
 
438
        }
 
439
    }
 
440
 
 
441
 
 
442
    public String getProcedureTerm() throws SQLException{
 
443
        // TODO Auto-generated method stub
 
444
        return null;
 
445
    }
 
446
 
 
447
 
 
448
    public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern)
 
449
            throws SQLException{
 
450
        try{
 
451
            // the description of the restrictions can you request with GetSchema("Restrictions")
 
452
            String[] restrictions = new String[]{catalog, schemaPattern, procedureNamePattern};
 
453
            DataTable data = netConn.GetSchema(OdbcMetaDataCollectionNames.Procedures, restrictions);
 
454
            return new JdbcOdbcDTResultSet(data);
 
455
        }catch(Throwable th){
 
456
            throw JdbcOdbcUtils.createSQLException(th);
 
457
        }
 
458
    }
 
459
 
 
460
 
 
461
    public int getResultSetHoldability(){
 
462
        throw new UnsupportedOperationException();
 
463
    }
 
464
 
 
465
 
 
466
    public RowIdLifetime getRowIdLifetime(){
 
467
        throw new UnsupportedOperationException();
 
468
    }
 
469
 
 
470
 
 
471
    public String getSQLKeywords() throws SQLException{
 
472
        try{
 
473
            DataTable dt = netConn.GetSchema(DbMetaDataCollectionNames.ReservedWords);
 
474
            final DataRowCollection rows = dt.get_Rows();
 
475
            final int count = rows.get_Count();
 
476
            final StringBuilder builder = new StringBuilder();
 
477
            for(int i=0; i<count; i++){
 
478
                String word = (String)rows.get_Item(i).get_Item(0);
 
479
                if(builder.length() > 0){
 
480
                    builder.append(',');
 
481
                }
 
482
                builder.append(word);
 
483
            }
 
484
            return builder.toString();
 
485
        }catch(Throwable th){
 
486
            throw JdbcOdbcUtils.createSQLException(th);
 
487
        }
 
488
    }
 
489
 
 
490
 
 
491
    public int getSQLStateType() throws SQLException{
 
492
        // TODO Auto-generated method stub
 
493
        return 0;
 
494
    }
 
495
 
 
496
 
 
497
    public String getSchemaTerm() throws SQLException{
 
498
        // TODO Auto-generated method stub
 
499
        return null;
 
500
    }
 
501
 
 
502
 
 
503
    public ResultSet getSchemas() throws SQLException{
 
504
        // TODO Auto-generated method stub
 
505
        return null;
 
506
    }
 
507
 
 
508
 
 
509
    public ResultSet getSchemas(String catalog, String schemaPattern){
 
510
        throw new UnsupportedOperationException();
 
511
    }
 
512
 
 
513
 
 
514
    public String getSearchStringEscape() throws SQLException{
 
515
        // TODO Auto-generated method stub
 
516
        return null;
 
517
    }
 
518
 
 
519
 
 
520
    public String getStringFunctions() throws SQLException{
 
521
        // TODO Auto-generated method stub
 
522
        return null;
 
523
    }
 
524
 
 
525
 
 
526
    public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern){
 
527
        throw new UnsupportedOperationException();
 
528
    }
 
529
 
 
530
 
 
531
    public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern){
 
532
        throw new UnsupportedOperationException();
 
533
    }
 
534
 
 
535
 
 
536
    public String getSystemFunctions() throws SQLException{
 
537
        // TODO Auto-generated method stub
 
538
        return null;
 
539
    }
 
540
 
 
541
 
 
542
    public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)
 
543
            throws SQLException{
 
544
        // TODO Auto-generated method stub
 
545
        return null;
 
546
    }
 
547
 
 
548
 
 
549
    public ResultSet getTableTypes() throws SQLException{
 
550
        // TODO Auto-generated method stub
 
551
        return null;
 
552
    }
 
553
 
 
554
 
 
555
    public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
 
556
            throws SQLException{
 
557
        try{
 
558
            // the description of the restrictions can you request with GetSchema("Restrictions")
 
559
            String[] restrictions = new String[]{catalog, schemaPattern, tableNamePattern};
 
560
            DataTable dt1 = netConn.GetSchema(OdbcMetaDataCollectionNames.Tables, restrictions);
 
561
            DataTable dt2 = netConn.GetSchema(OdbcMetaDataCollectionNames.Views, restrictions);
 
562
            // concatenate the both DataTable
 
563
            DataRowCollection rows1 = dt1.get_Rows();
 
564
            DataRowCollection rows2 = dt2.get_Rows();
 
565
            for(int i = 0; i < rows2.get_Count(); i++){
 
566
                DataRow row = rows2.get_Item(i);
 
567
                rows1.Add(row.get_ItemArray());
 
568
            }
 
569
            if(types != null){
 
570
                RowLoop:
 
571
                // Filter the types
 
572
                for(int i = rows1.get_Count() - 1; i >= 0; i--){
 
573
                    DataRow row = rows1.get_Item(i);
 
574
                    Object tableType = row.get_Item("TABLE_TYPE");
 
575
                    for(String type : types){
 
576
                        if(type.equals(tableType)){
 
577
                            continue RowLoop;
 
578
                        }
 
579
                    }
 
580
                    rows1.RemoveAt(i);
 
581
                }
 
582
            }
 
583
            return new JdbcOdbcDTResultSet(dt1);
 
584
        }catch(Throwable th){
 
585
            throw JdbcOdbcUtils.createSQLException(th);
 
586
        }
 
587
    }
 
588
 
 
589
 
 
590
    public String getTimeDateFunctions() throws SQLException{
 
591
        // TODO Auto-generated method stub
 
592
        return null;
 
593
    }
 
594
 
 
595
 
 
596
    public ResultSet getTypeInfo() throws SQLException{
 
597
        try{
 
598
            //TODO Column Names and order are wrong
 
599
            DataTable data = netConn.GetSchema(DbMetaDataCollectionNames.DataTypes);
 
600
            return new JdbcOdbcDTResultSet(data);
 
601
        }catch(Throwable th){
 
602
            throw JdbcOdbcUtils.createSQLException(th);
 
603
        }
 
604
    }
 
605
 
 
606
 
 
607
    public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types){
 
608
        throw new UnsupportedOperationException();
 
609
    }
 
610
 
 
611
 
 
612
    public String getURL() throws SQLException{
 
613
        // TODO Auto-generated method stub
 
614
        return null;
 
615
    }
 
616
 
 
617
 
 
618
    public String getUserName() throws SQLException{
 
619
        // TODO Auto-generated method stub
 
620
        return null;
 
621
    }
 
622
 
 
623
 
 
624
    public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException{
 
625
        // TODO Auto-generated method stub
 
626
        return null;
 
627
    }
 
628
 
 
629
 
 
630
    public boolean insertsAreDetected(int type) throws SQLException{
 
631
        // TODO Auto-generated method stub
 
632
        return false;
 
633
    }
 
634
 
 
635
 
 
636
    public boolean isCatalogAtStart() throws SQLException{
 
637
        // TODO Auto-generated method stub
 
638
        return false;
 
639
    }
 
640
 
 
641
 
 
642
    public boolean isReadOnly() throws SQLException{
 
643
        // TODO Auto-generated method stub
 
644
        return false;
 
645
    }
 
646
 
 
647
 
 
648
    public boolean locatorsUpdateCopy(){
 
649
        throw new UnsupportedOperationException();
 
650
    }
 
651
 
 
652
 
 
653
    public boolean nullPlusNonNullIsNull() throws SQLException{
 
654
        // TODO Auto-generated method stub
 
655
        return false;
 
656
    }
 
657
 
 
658
 
 
659
    public boolean nullsAreSortedAtEnd() throws SQLException{
 
660
        // TODO Auto-generated method stub
 
661
        return false;
 
662
    }
 
663
 
 
664
 
 
665
    public boolean nullsAreSortedAtStart() throws SQLException{
 
666
        // TODO Auto-generated method stub
 
667
        return false;
 
668
    }
 
669
 
 
670
 
 
671
    public boolean nullsAreSortedHigh() throws SQLException{
 
672
        // TODO Auto-generated method stub
 
673
        return false;
 
674
    }
 
675
 
 
676
 
 
677
    public boolean nullsAreSortedLow() throws SQLException{
 
678
        // TODO Auto-generated method stub
 
679
        return false;
 
680
    }
 
681
 
 
682
 
 
683
    public boolean othersDeletesAreVisible(int type) throws SQLException{
 
684
        // TODO Auto-generated method stub
 
685
        return false;
 
686
    }
 
687
 
 
688
 
 
689
    public boolean othersInsertsAreVisible(int type) throws SQLException{
 
690
        // TODO Auto-generated method stub
 
691
        return false;
 
692
    }
 
693
 
 
694
 
 
695
    public boolean othersUpdatesAreVisible(int type) throws SQLException{
 
696
        // TODO Auto-generated method stub
 
697
        return false;
 
698
    }
 
699
 
 
700
 
 
701
    public boolean ownDeletesAreVisible(int type) throws SQLException{
 
702
        // TODO Auto-generated method stub
 
703
        return false;
 
704
    }
 
705
 
 
706
 
 
707
    public boolean ownInsertsAreVisible(int type) throws SQLException{
 
708
        // TODO Auto-generated method stub
 
709
        return false;
 
710
    }
 
711
 
 
712
 
 
713
    public boolean ownUpdatesAreVisible(int type) throws SQLException{
 
714
        // TODO Auto-generated method stub
 
715
        return false;
 
716
    }
 
717
 
 
718
 
 
719
    public boolean storesLowerCaseIdentifiers() throws SQLException{
 
720
        // TODO Auto-generated method stub
 
721
        return false;
 
722
    }
 
723
 
 
724
 
 
725
    public boolean storesLowerCaseQuotedIdentifiers() throws SQLException{
 
726
        // TODO Auto-generated method stub
 
727
        return false;
 
728
    }
 
729
 
 
730
 
 
731
    public boolean storesMixedCaseIdentifiers() throws SQLException{
 
732
        // TODO Auto-generated method stub
 
733
        return false;
 
734
    }
 
735
 
 
736
 
 
737
    public boolean storesMixedCaseQuotedIdentifiers() throws SQLException{
 
738
        // TODO Auto-generated method stub
 
739
        return false;
 
740
    }
 
741
 
 
742
 
 
743
    public boolean storesUpperCaseIdentifiers() throws SQLException{
 
744
        // TODO Auto-generated method stub
 
745
        return false;
 
746
    }
 
747
 
 
748
 
 
749
    public boolean storesUpperCaseQuotedIdentifiers() throws SQLException{
 
750
        // TODO Auto-generated method stub
 
751
        return false;
 
752
    }
 
753
 
 
754
 
 
755
    public boolean supportsANSI92EntryLevelSQL() throws SQLException{
 
756
        // TODO Auto-generated method stub
 
757
        return false;
 
758
    }
 
759
 
 
760
 
 
761
    public boolean supportsANSI92FullSQL() throws SQLException{
 
762
        // TODO Auto-generated method stub
 
763
        return false;
 
764
    }
 
765
 
 
766
 
 
767
    public boolean supportsANSI92IntermediateSQL() throws SQLException{
 
768
        // TODO Auto-generated method stub
 
769
        return false;
 
770
    }
 
771
 
 
772
 
 
773
    public boolean supportsAlterTableWithAddColumn() throws SQLException{
 
774
        // TODO Auto-generated method stub
 
775
        return false;
 
776
    }
 
777
 
 
778
 
 
779
    public boolean supportsAlterTableWithDropColumn() throws SQLException{
 
780
        // TODO Auto-generated method stub
 
781
        return false;
 
782
    }
 
783
 
 
784
 
 
785
    public boolean supportsBatchUpdates() throws SQLException{
 
786
        // TODO Auto-generated method stub
 
787
        return false;
 
788
    }
 
789
 
 
790
 
 
791
    public boolean supportsCatalogsInDataManipulation() throws SQLException{
 
792
        // TODO Auto-generated method stub
 
793
        return false;
 
794
    }
 
795
 
 
796
 
 
797
    public boolean supportsCatalogsInIndexDefinitions() throws SQLException{
 
798
        // TODO Auto-generated method stub
 
799
        return false;
 
800
    }
 
801
 
 
802
 
 
803
    public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException{
 
804
        // TODO Auto-generated method stub
 
805
        return false;
 
806
    }
 
807
 
 
808
 
 
809
    public boolean supportsCatalogsInProcedureCalls() throws SQLException{
 
810
        // TODO Auto-generated method stub
 
811
        return false;
 
812
    }
 
813
 
 
814
 
 
815
    public boolean supportsCatalogsInTableDefinitions() throws SQLException{
 
816
        // TODO Auto-generated method stub
 
817
        return false;
 
818
    }
 
819
 
 
820
 
 
821
    public boolean supportsColumnAliasing() throws SQLException{
 
822
        // TODO Auto-generated method stub
 
823
        return false;
 
824
    }
 
825
 
 
826
 
 
827
    public boolean supportsConvert() throws SQLException{
 
828
        // TODO Auto-generated method stub
 
829
        return false;
 
830
    }
 
831
 
 
832
 
 
833
    public boolean supportsConvert(int fromType, int toType) throws SQLException{
 
834
        // TODO Auto-generated method stub
 
835
        return false;
 
836
    }
 
837
 
 
838
 
 
839
    public boolean supportsCoreSQLGrammar() throws SQLException{
 
840
        // TODO Auto-generated method stub
 
841
        return false;
 
842
    }
 
843
 
 
844
 
 
845
    public boolean supportsCorrelatedSubqueries() throws SQLException{
 
846
        // TODO Auto-generated method stub
 
847
        return false;
 
848
    }
 
849
 
 
850
 
 
851
    public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException{
 
852
        // TODO Auto-generated method stub
 
853
        return false;
 
854
    }
 
855
 
 
856
 
 
857
    public boolean supportsDataManipulationTransactionsOnly() throws SQLException{
 
858
        // TODO Auto-generated method stub
 
859
        return false;
 
860
    }
 
861
 
 
862
 
 
863
    public boolean supportsDifferentTableCorrelationNames() throws SQLException{
 
864
        // TODO Auto-generated method stub
 
865
        return false;
 
866
    }
 
867
 
 
868
 
 
869
    public boolean supportsExpressionsInOrderBy() throws SQLException{
 
870
        // TODO Auto-generated method stub
 
871
        return false;
 
872
    }
 
873
 
 
874
 
 
875
    public boolean supportsExtendedSQLGrammar() throws SQLException{
 
876
        // TODO Auto-generated method stub
 
877
        return false;
 
878
    }
 
879
 
 
880
 
 
881
    public boolean supportsFullOuterJoins() throws SQLException{
 
882
        int join = CIL.unbox_int(getInfo(DbMetaDataColumnNames.SupportedJoinOperators));
 
883
        return (join & SupportedJoinOperators.FullOuter) > 0;
 
884
    }
 
885
 
 
886
 
 
887
    public boolean supportsGetGeneratedKeys() throws SQLException{
 
888
        // TODO Auto-generated method stub
 
889
        return false;
 
890
    }
 
891
 
 
892
 
 
893
    public boolean supportsGroupBy() throws SQLException{
 
894
        int behavior = CIL.unbox_int(getInfo(DbMetaDataColumnNames.GroupByBehavior));
 
895
        return behavior != GroupByBehavior.NotSupported;
 
896
    }
 
897
 
 
898
 
 
899
    public boolean supportsGroupByBeyondSelect() throws SQLException{
 
900
        int behavior = CIL.unbox_int(getInfo(DbMetaDataColumnNames.GroupByBehavior));
 
901
        return behavior == GroupByBehavior.MustContainAll;
 
902
    }
 
903
 
 
904
 
 
905
    public boolean supportsGroupByUnrelated() throws SQLException{
 
906
        int behavior = CIL.unbox_int(getInfo(DbMetaDataColumnNames.GroupByBehavior));
 
907
        return behavior == GroupByBehavior.Unrelated;
 
908
    }
 
909
 
 
910
 
 
911
    public boolean supportsIntegrityEnhancementFacility() throws SQLException{
 
912
        // TODO Auto-generated method stub
 
913
        return false;
 
914
    }
 
915
 
 
916
 
 
917
    public boolean supportsLikeEscapeClause() throws SQLException{
 
918
        return getSQLKeywords().toUpperCase().indexOf(",LIKE,") > 0;
 
919
    }
 
920
 
 
921
 
 
922
    public boolean supportsLimitedOuterJoins() throws SQLException{
 
923
        int join = CIL.unbox_int(getInfo(DbMetaDataColumnNames.SupportedJoinOperators));
 
924
        return join > 0;
 
925
    }
 
926
 
 
927
 
 
928
    public boolean supportsMinimumSQLGrammar() throws SQLException{
 
929
        // TODO Auto-generated method stub
 
930
        return false;
 
931
    }
 
932
 
 
933
 
 
934
    public boolean supportsMixedCaseIdentifiers() throws SQLException{
 
935
        int identifierCase = CIL.unbox_int(getInfo(DbMetaDataColumnNames.IdentifierCase));
 
936
        return identifierCase == IdentifierCase.Sensitive;
 
937
    }
 
938
 
 
939
 
 
940
    public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException{
 
941
        int identifierCase = CIL.unbox_int(getInfo(DbMetaDataColumnNames.QuotedIdentifierCase));
 
942
        return identifierCase == IdentifierCase.Sensitive;
 
943
    }
 
944
 
 
945
 
 
946
    public boolean supportsMultipleOpenResults() throws SQLException{
 
947
        // TODO Auto-generated method stub
 
948
        return false;
 
949
    }
 
950
 
 
951
 
 
952
    public boolean supportsMultipleResultSets() throws SQLException{
 
953
        // TODO Auto-generated method stub
 
954
        return false;
 
955
    }
 
956
 
 
957
 
 
958
    public boolean supportsMultipleTransactions() throws SQLException{
 
959
        // TODO Auto-generated method stub
 
960
        return false;
 
961
    }
 
962
 
 
963
 
 
964
    public boolean supportsNamedParameters() throws SQLException{
 
965
        // TODO Auto-generated method stub
 
966
        return false;
 
967
    }
 
968
 
 
969
 
 
970
    public boolean supportsNonNullableColumns() throws SQLException{
 
971
        // TODO Auto-generated method stub
 
972
        return false;
 
973
    }
 
974
 
 
975
 
 
976
    public boolean supportsOpenCursorsAcrossCommit() throws SQLException{
 
977
        // TODO Auto-generated method stub
 
978
        return false;
 
979
    }
 
980
 
 
981
 
 
982
    public boolean supportsOpenCursorsAcrossRollback() throws SQLException{
 
983
        // TODO Auto-generated method stub
 
984
        return false;
 
985
    }
 
986
 
 
987
 
 
988
    public boolean supportsOpenStatementsAcrossCommit() throws SQLException{
 
989
        // TODO Auto-generated method stub
 
990
        return false;
 
991
    }
 
992
 
 
993
 
 
994
    public boolean supportsOpenStatementsAcrossRollback() throws SQLException{
 
995
        // TODO Auto-generated method stub
 
996
        return false;
 
997
    }
 
998
 
 
999
 
 
1000
    public boolean supportsOrderByUnrelated() throws SQLException{
 
1001
        return CIL.unbox_boolean( getInfo(DbMetaDataColumnNames.OrderByColumnsInSelect));
 
1002
    }
 
1003
 
 
1004
 
 
1005
    public boolean supportsOuterJoins() throws SQLException{
 
1006
        int join = CIL.unbox_int(getInfo(DbMetaDataColumnNames.SupportedJoinOperators));
 
1007
        return (join & SupportedJoinOperators.LeftOuter) > 0 || (join & SupportedJoinOperators.RightOuter) > 0;
 
1008
    }
 
1009
 
 
1010
 
 
1011
    public boolean supportsPositionedDelete() throws SQLException{
 
1012
        // TODO Auto-generated method stub
 
1013
        return false;
 
1014
    }
 
1015
 
 
1016
 
 
1017
    public boolean supportsPositionedUpdate() throws SQLException{
 
1018
        // TODO Auto-generated method stub
 
1019
        return false;
 
1020
    }
 
1021
 
 
1022
 
 
1023
    public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException{
 
1024
        // TODO Auto-generated method stub
 
1025
        return false;
 
1026
    }
 
1027
 
 
1028
 
 
1029
    public boolean supportsResultSetHoldability(int holdability){
 
1030
        throw new UnsupportedOperationException();
 
1031
    }
 
1032
 
 
1033
 
 
1034
    public boolean supportsResultSetType(int type) throws SQLException{
 
1035
        // TODO Auto-generated method stub
 
1036
        return false;
 
1037
    }
 
1038
 
 
1039
 
 
1040
    public boolean supportsSavepoints() throws SQLException{
 
1041
        // TODO Auto-generated method stub
 
1042
        return false;
 
1043
    }
 
1044
 
 
1045
 
 
1046
    public boolean supportsSchemasInDataManipulation() throws SQLException{
 
1047
        // TODO Auto-generated method stub
 
1048
        return false;
 
1049
    }
 
1050
 
 
1051
 
 
1052
    public boolean supportsSchemasInIndexDefinitions() throws SQLException{
 
1053
        // TODO Auto-generated method stub
 
1054
        return false;
 
1055
    }
 
1056
 
 
1057
 
 
1058
    public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException{
 
1059
        // TODO Auto-generated method stub
 
1060
        return false;
 
1061
    }
 
1062
 
 
1063
 
 
1064
    public boolean supportsSchemasInProcedureCalls() throws SQLException{
 
1065
        // TODO Auto-generated method stub
 
1066
        return false;
 
1067
    }
 
1068
 
 
1069
 
 
1070
    public boolean supportsSchemasInTableDefinitions() throws SQLException{
 
1071
        // TODO Auto-generated method stub
 
1072
        return false;
 
1073
    }
 
1074
 
 
1075
 
 
1076
    public boolean supportsSelectForUpdate() throws SQLException{
 
1077
        // TODO Auto-generated method stub
 
1078
        return false;
 
1079
    }
 
1080
 
 
1081
 
 
1082
    public boolean supportsStatementPooling(){
 
1083
        throw new UnsupportedOperationException();
 
1084
    }
 
1085
 
 
1086
 
 
1087
    public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException{
 
1088
        throw new UnsupportedOperationException();
 
1089
    }
 
1090
 
 
1091
 
 
1092
    public boolean supportsStoredProcedures() throws SQLException{
 
1093
        // TODO Auto-generated method stub
 
1094
        return false;
 
1095
    }
 
1096
 
 
1097
 
 
1098
    public boolean supportsSubqueriesInComparisons() throws SQLException{
 
1099
        // TODO Auto-generated method stub
 
1100
        return false;
 
1101
    }
 
1102
 
 
1103
 
 
1104
    public boolean supportsSubqueriesInExists() throws SQLException{
 
1105
        // TODO Auto-generated method stub
 
1106
        return false;
 
1107
    }
 
1108
 
 
1109
 
 
1110
    public boolean supportsSubqueriesInIns() throws SQLException{
 
1111
        // TODO Auto-generated method stub
 
1112
        return false;
 
1113
    }
 
1114
 
 
1115
 
 
1116
    public boolean supportsSubqueriesInQuantifieds() throws SQLException{
 
1117
        // TODO Auto-generated method stub
 
1118
        return false;
 
1119
    }
 
1120
 
 
1121
 
 
1122
    public boolean supportsTableCorrelationNames() throws SQLException{
 
1123
        // TODO Auto-generated method stub
 
1124
        return false;
 
1125
    }
 
1126
 
 
1127
 
 
1128
    public boolean supportsTransactionIsolationLevel(int level) throws SQLException{
 
1129
        // TODO Auto-generated method stub
 
1130
        return false;
 
1131
    }
 
1132
 
 
1133
 
 
1134
    public boolean supportsTransactions() throws SQLException{
 
1135
        // TODO Auto-generated method stub
 
1136
        return false;
 
1137
    }
 
1138
 
 
1139
 
 
1140
    public boolean supportsUnion() throws SQLException{
 
1141
        // TODO Auto-generated method stub
 
1142
        return false;
 
1143
    }
 
1144
 
 
1145
 
 
1146
    public boolean supportsUnionAll() throws SQLException{
 
1147
        // TODO Auto-generated method stub
 
1148
        return false;
 
1149
    }
 
1150
 
 
1151
 
 
1152
    public boolean updatesAreDetected(int type) throws SQLException{
 
1153
        // TODO Auto-generated method stub
 
1154
        return false;
 
1155
    }
 
1156
 
 
1157
 
 
1158
    public boolean usesLocalFilePerTable() throws SQLException{
 
1159
        // TODO Auto-generated method stub
 
1160
        return false;
 
1161
    }
 
1162
 
 
1163
 
 
1164
    public boolean usesLocalFiles() throws SQLException{
 
1165
        // TODO Auto-generated method stub
 
1166
        return false;
 
1167
    }
 
1168
 
 
1169
 
 
1170
    public boolean isWrapperFor(Class<?> iface){
 
1171
        return iface.isAssignableFrom(this.getClass());
 
1172
    }
 
1173
 
 
1174
 
 
1175
    public <T>T unwrap(Class<T> iface) throws SQLException{
 
1176
        if(isWrapperFor(iface)){
 
1177
            return (T)this;
 
1178
        }
 
1179
        throw new SQLException(this.getClass().getName() + " does not implements " + iface.getName() + ".", "01000");
 
1180
    }
 
1181
 
 
1182
    private Object getInfo(String key) throws SQLException{
 
1183
        try{
 
1184
            if(dataSourceInfo == null){
 
1185
                DataTable td = netConn.GetSchema(DbMetaDataCollectionNames.DataSourceInformation);
 
1186
                dataSourceInfo = td.get_Rows().get_Item(0);
 
1187
            }
 
1188
            return dataSourceInfo.get_Item(key);
 
1189
        }catch(Throwable th){
 
1190
            throw JdbcOdbcUtils.createSQLException(th);
 
1191
        }
 
1192
    }
 
1193
 
 
1194
 
 
1195
        /**
 
1196
         * {@inheritDoc}
 
1197
         */
 
1198
        public ResultSet getPseudoColumns(String catalog, String schemaPattern,
 
1199
                        String tableNamePattern, String columnNamePattern)
 
1200
                        throws SQLException {
 
1201
                throw new SQLFeatureNotSupportedException();
 
1202
        }
 
1203
 
 
1204
 
 
1205
        /**
 
1206
         * {@inheritDoc}
 
1207
         */
 
1208
        public boolean generatedKeyAlwaysReturned() throws SQLException {
 
1209
                return false;
 
1210
        }
 
1211
}