KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > functionTests > util > metadataHelperProcs


1 /*
2
3    Derby - Class org.apache.derbyTesting.functionTests.tests.store.metadataHelperProcs
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyTesting.functionTests.util;
23
24 import java.sql.Connection JavaDoc;
25 import java.sql.DriverManager JavaDoc;
26 import java.sql.ResultSet JavaDoc;
27 import java.sql.SQLException JavaDoc;
28 import java.sql.DatabaseMetaData JavaDoc;
29
30 public class metadataHelperProcs {
31     
32    
33     public static ResultSet JavaDoc rs;
34
35     // for use in test getbestrowidentifier.sql
36
public static void getBestRowId(String JavaDoc schema, String JavaDoc tableName, int scope, String JavaDoc nullable, ResultSet JavaDoc[] rs) throws SQLException JavaDoc
37     {
38         Connection JavaDoc conn = DriverManager.getConnection("jdbc:default:connection");
39         boolean tf = true;
40         if (nullable.equals("false"))
41             tf = false;
42         rs[0] = conn.getMetaData().getBestRowIdentifier(null,schema.trim(),tableName.trim(),scope,tf);
43     }
44
45 }
46
Popular Tags