KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > jdbc > EngineParameterMetaData


1 /*
2  
3  Derby - Class org.apache.derby.iapi.jdbc.EngineParameterMetaData
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 package org.apache.derby.iapi.jdbc;
22
23 import java.sql.SQLException JavaDoc;
24 import java.sql.PreparedStatement JavaDoc;
25
26
27 /**
28  * An internal api only, mainly for use in the network server.
29  *
30  * This interface imitates the ParameterMetaData interface from JDBC3.0
31  * We want to provide the ParameterMetaData functionality to JDKs before JDBC3.0.
32  * org.apache.derby.iapi.jdbc.EnginePreparedStatement interface returns an object
33  * of this type on a getEmbedParameterSetMetaData
34  * Once,JDK1.3 stops being supported, this interface can be removed and
35  * instead the JDBC 3.0 Class ParameterMetaData can be used
36  */

37 public interface EngineParameterMetaData {
38     
39     /**
40      * Retrieves the number of parameters in the PreparedStatement object for which
41      * this ParameterMetaData object contains information.
42      *
43      * @return the number of parameters
44      */

45     public int getParameterCount();
46     
47     /**
48      * Retrieves whether null values are allowed in the designated parameter.
49      *
50      * @param param - the first parameter is 1, the second is 2, ...
51      * @return the nullability status of the given parameter; one of
52      * ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullable, or
53      * ParameterMetaData.parameterNullableUnknown
54      * @exception SQLException if a database access error occurs
55      */

56     public int isNullable(int param) throws SQLException JavaDoc;
57     
58     /**
59      * Retrieves whether values for the designated parameter can be signed numbers.
60      *
61      * @param param - the first parameter is 1, the second is 2, ...
62      * @return true if it can be signed numbers
63      * @exception SQLException if a database access error occurs
64      */

65     public boolean isSigned(int param) throws SQLException JavaDoc;
66     
67     /**
68      * Retrieves the designated parameter's number of decimal digits.
69      *
70      * @param param - the first parameter is 1, the second is 2, ...
71      * @return precision
72      * @exception SQLException if a database access error occurs
73      */

74     public int getPrecision(int param) throws SQLException JavaDoc;
75     
76     /**
77      * Retrieves the designated parameter's number of digits to right of the decimal point.
78      *
79      * @param param - the first parameter is 1, the second is 2, ...
80      * @return scale
81      * @exception SQLException if a database access error occurs
82      */

83     public int getScale(int param) throws SQLException JavaDoc;
84     /**
85      *
86      * Retrieves the designated parameter's SQL type.
87      *
88      * @param param - the first parameter is 1, the second is 2, ...
89      * @return SQL type from java.sql.Types
90      * @exception SQLException if a database access error occurs
91      */

92     public int getParameterType(int param) throws SQLException JavaDoc;
93     /**
94      *
95      * Retrieves the designated parameter's database-specific type name.
96      *
97      * @param param - the first parameter is 1, the second is 2, ...
98      * @return type the name used by the database. If the parameter
99      * type is a user-defined type, then a fully-qualified type name is returned.
100      * @exception SQLException if a database access error occurs
101      */

102     public String JavaDoc getParameterTypeName(int param) throws SQLException JavaDoc;
103     
104     /**
105      * Retrieves the fully-qualified name of the Java class whose instances should be
106      * passed to the method PreparedStatement.setObject.
107      *
108      * @param param - the first parameter is 1, the second is 2, ...
109      * @return the fully-qualified name of the class in the Java
110      * programming language that would be used by the method
111      * PreparedStatement.setObject to set the value in the specified parameter.
112      * This is the class name used for custom mapping.
113      * @exception SQLException if a database access error occurs
114      */

115     public String JavaDoc getParameterClassName(int param) throws SQLException JavaDoc;
116     
117     /**
118      * Retrieves the designated parameter's mode.
119      *
120      * @param param - the first parameter is 1, the second is 2, ...
121      * @return mode of the parameter; one of ParameterMetaData.parameterModeIn,
122      * ParameterMetaData.parameterModeOut, or ParameterMetaData.parameterModeInOut
123      * ParameterMetaData.parameterModeUnknown.
124      * @exception SQLException if a database access error occurs
125      */

126     public int getParameterMode(int param) throws SQLException JavaDoc;
127     
128 }
129
Popular Tags