KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > adapter > jdbc > remote > SerializableParameterMetaData


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.resource.adapter.jdbc.remote;
23
24 import java.io.Serializable JavaDoc;
25 import java.sql.ParameterMetaData JavaDoc;
26 import java.sql.SQLException JavaDoc;
27
28 /**
29  * @author <a HREF="mailto:telrod@e2technologies.net">Tom Elrod</a>
30  * @version $Revision: 37459 $
31  */

32 public class SerializableParameterMetaData implements ParameterMetaData JavaDoc, Serializable JavaDoc
33 {
34    /** @since 1.1 */
35    static final long serialVersionUID = -6601828413479683906L;
36    int parameterCount = 0;
37
38    public SerializableParameterMetaData(ParameterMetaData JavaDoc pMetaData) throws SQLException JavaDoc
39    {
40       this.parameterCount = pMetaData.getParameterCount();
41    }
42
43    /**
44     * Retrieves the number of parameters in the <code>PreparedStatement</code>
45     * object for which this <code>ParameterMetaData</code> object contains
46     * information.
47     *
48     * @return the number of parameters
49     * @throws java.sql.SQLException if a database access error occurs
50     * @since 1.4
51     */

52    public int getParameterCount() throws SQLException JavaDoc
53    {
54       return parameterCount;
55    }
56
57    /**
58     * Retrieves the designated parameter's mode.
59     *
60     * @param param the first parameter is 1, the second is 2, ...
61     * @return mode of the parameter; one of
62     * <code>ParameterMetaData.parameterModeIn</code>,
63     * <code>ParameterMetaData.parameterModeOut</code>, or
64     * <code>ParameterMetaData.parameterModeInOut</code>
65     * <code>ParameterMetaData.parameterModeUnknown</code>.
66     * @throws java.sql.SQLException if a database access error occurs
67     * @since 1.4
68     */

69    public int getParameterMode(int param) throws SQLException JavaDoc
70    {
71       return 0;
72    }
73
74    /**
75     * Retrieves the designated parameter's SQL type.
76     *
77     * @param param the first parameter is 1, the second is 2, ...
78     * @return SQL type from <code>java.sql.Types</code>
79     * @throws java.sql.SQLException if a database access error occurs
80     * @see java.sql.Types
81     * @since 1.4
82     */

83    public int getParameterType(int param) throws SQLException JavaDoc
84    {
85       return 0;
86    }
87
88    /**
89     * Retrieves the designated parameter's number of decimal digits.
90     *
91     * @param param the first parameter is 1, the second is 2, ...
92     * @return precision
93     * @throws java.sql.SQLException if a database access error occurs
94     * @since 1.4
95     */

96    public int getPrecision(int param) throws SQLException JavaDoc
97    {
98       return 0;
99    }
100
101    /**
102     * Retrieves the designated parameter's number of digits to right of the decimal point.
103     *
104     * @param param the first parameter is 1, the second is 2, ...
105     * @return scale
106     * @throws java.sql.SQLException if a database access error occurs
107     * @since 1.4
108     */

109    public int getScale(int param) throws SQLException JavaDoc
110    {
111       return 0;
112    }
113
114    /**
115     * Retrieves whether null values are allowed in the designated parameter.
116     *
117     * @param param the first parameter is 1, the second is 2, ...
118     * @return the nullability status of the given parameter; one of
119     * <code>ParameterMetaData.parameterNoNulls</code>,
120     * <code>ParameterMetaData.parameterNullable</code>, or
121     * <code>ParameterMetaData.parameterNullableUnknown</code>
122     * @throws java.sql.SQLException if a database access error occurs
123     * @since 1.4
124     */

125    public int isNullable(int param) throws SQLException JavaDoc
126    {
127       return 0;
128    }
129
130    /**
131     * Retrieves whether values for the designated parameter can be signed numbers.
132     *
133     * @param param the first parameter is 1, the second is 2, ...
134     * @return <code>true</code> if so; <code>false</code> otherwise
135     * @throws java.sql.SQLException if a database access error occurs
136     * @since 1.4
137     */

138    public boolean isSigned(int param) throws SQLException JavaDoc
139    {
140       return false;
141    }
142
143    /**
144     * Retrieves the fully-qualified name of the Java class whose instances
145     * should be passed to the method <code>PreparedStatement.setObject</code>.
146     *
147     * @param param the first parameter is 1, the second is 2, ...
148     * @return the fully-qualified name of the class in the Java programming
149     * language that would be used by the method
150     * <code>PreparedStatement.setObject</code> to set the value
151     * in the specified parameter. This is the class name used
152     * for custom mapping.
153     * @throws java.sql.SQLException if a database access error occurs
154     * @since 1.4
155     */

156    public String JavaDoc getParameterClassName(int param) throws SQLException JavaDoc
157    {
158       return null;
159    }
160
161    /**
162     * Retrieves the designated parameter's database-specific type name.
163     *
164     * @param param the first parameter is 1, the second is 2, ...
165     * @return type the name used by the database. If the parameter type is
166     * a user-defined type, then a fully-qualified type name is returned.
167     * @throws java.sql.SQLException if a database access error occurs
168     * @since 1.4
169     */

170    public String JavaDoc getParameterTypeName(int param) throws SQLException JavaDoc
171    {
172       return null;
173    }
174 }
175
176
177
Popular Tags