01: /*
02:
03: Derby - Class org.apache.derbyTesting.functionTests.tests.lang.WarehouseVTI
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (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.tests.lang;
23:
24: import java.sql.SQLException;
25:
26: /**
27: * Cooked up VTI to test SYSCS_BULK_INSERT
28: */
29: public class WarehouseVTI extends TableVTI {
30: private int maxRows;
31: private int row = 0;
32:
33: public WarehouseVTI(String schemaName, String tableName,
34: String maxRows) throws SQLException {
35: super (tableName);
36: this .maxRows = Integer.parseInt(maxRows);
37: }
38:
39: public boolean next() {
40:
41: if (++row <= maxRows)
42: return true;
43: else
44: return false;
45:
46: }
47:
48: public int getInt(int col)
49:
50: {
51: switch (col) {
52: case 1:
53: return row;
54: default:
55: System.out.println("ERROR! INVALID COLUMN");
56: }
57: return 0;
58: }
59:
60: }
|