001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.resource.adapter.jdbc.remote;
023:
024: import java.io.Serializable;
025: import java.sql.ParameterMetaData;
026: import java.sql.SQLException;
027:
028: /**
029: * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
030: * @version $Revision: 57189 $
031: */
032: public class SerializableParameterMetaData implements
033: ParameterMetaData, Serializable {
034: /** @since 1.1 */
035: static final long serialVersionUID = -6601828413479683906L;
036: int parameterCount = 0;
037:
038: public SerializableParameterMetaData(ParameterMetaData pMetaData)
039: throws SQLException {
040: this .parameterCount = pMetaData.getParameterCount();
041: }
042:
043: /**
044: * Retrieves the number of parameters in the <code>PreparedStatement</code>
045: * object for which this <code>ParameterMetaData</code> object contains
046: * information.
047: *
048: * @return the number of parameters
049: * @throws java.sql.SQLException if a database access error occurs
050: * @since 1.4
051: */
052: public int getParameterCount() throws SQLException {
053: return parameterCount;
054: }
055:
056: /**
057: * Retrieves the designated parameter's mode.
058: *
059: * @param param the first parameter is 1, the second is 2, ...
060: * @return mode of the parameter; one of
061: * <code>ParameterMetaData.parameterModeIn</code>,
062: * <code>ParameterMetaData.parameterModeOut</code>, or
063: * <code>ParameterMetaData.parameterModeInOut</code>
064: * <code>ParameterMetaData.parameterModeUnknown</code>.
065: * @throws java.sql.SQLException if a database access error occurs
066: * @since 1.4
067: */
068: public int getParameterMode(int param) throws SQLException {
069: return 0;
070: }
071:
072: /**
073: * Retrieves the designated parameter's SQL type.
074: *
075: * @param param the first parameter is 1, the second is 2, ...
076: * @return SQL type from <code>java.sql.Types</code>
077: * @throws java.sql.SQLException if a database access error occurs
078: * @see java.sql.Types
079: * @since 1.4
080: */
081: public int getParameterType(int param) throws SQLException {
082: return 0;
083: }
084:
085: /**
086: * Retrieves the designated parameter's number of decimal digits.
087: *
088: * @param param the first parameter is 1, the second is 2, ...
089: * @return precision
090: * @throws java.sql.SQLException if a database access error occurs
091: * @since 1.4
092: */
093: public int getPrecision(int param) throws SQLException {
094: return 0;
095: }
096:
097: /**
098: * Retrieves the designated parameter's number of digits to right of the decimal point.
099: *
100: * @param param the first parameter is 1, the second is 2, ...
101: * @return scale
102: * @throws java.sql.SQLException if a database access error occurs
103: * @since 1.4
104: */
105: public int getScale(int param) throws SQLException {
106: return 0;
107: }
108:
109: /**
110: * Retrieves whether null values are allowed in the designated parameter.
111: *
112: * @param param the first parameter is 1, the second is 2, ...
113: * @return the nullability status of the given parameter; one of
114: * <code>ParameterMetaData.parameterNoNulls</code>,
115: * <code>ParameterMetaData.parameterNullable</code>, or
116: * <code>ParameterMetaData.parameterNullableUnknown</code>
117: * @throws java.sql.SQLException if a database access error occurs
118: * @since 1.4
119: */
120: public int isNullable(int param) throws SQLException {
121: return 0;
122: }
123:
124: /**
125: * Retrieves whether values for the designated parameter can be signed numbers.
126: *
127: * @param param the first parameter is 1, the second is 2, ...
128: * @return <code>true</code> if so; <code>false</code> otherwise
129: * @throws java.sql.SQLException if a database access error occurs
130: * @since 1.4
131: */
132: public boolean isSigned(int param) throws SQLException {
133: return false;
134: }
135:
136: /**
137: * Retrieves the fully-qualified name of the Java class whose instances
138: * should be passed to the method <code>PreparedStatement.setObject</code>.
139: *
140: * @param param the first parameter is 1, the second is 2, ...
141: * @return the fully-qualified name of the class in the Java programming
142: * language that would be used by the method
143: * <code>PreparedStatement.setObject</code> to set the value
144: * in the specified parameter. This is the class name used
145: * for custom mapping.
146: * @throws java.sql.SQLException if a database access error occurs
147: * @since 1.4
148: */
149: public String getParameterClassName(int param) throws SQLException {
150: return null;
151: }
152:
153: /**
154: * Retrieves the designated parameter's database-specific type name.
155: *
156: * @param param the first parameter is 1, the second is 2, ...
157: * @return type the name used by the database. If the parameter type is
158: * a user-defined type, then a fully-qualified type name is returned.
159: * @throws java.sql.SQLException if a database access error occurs
160: * @since 1.4
161: */
162: public String getParameterTypeName(int param) throws SQLException {
163: return null;
164: }
165: }
|