KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > in > co > daffodil > db > jdbc > DaffodilDBSQLInput


1 package in.co.daffodil.db.jdbc;
2
3 import java.sql.*;
4 import com.daffodilwoods.database.resource.*;
5
6 public class DaffodilDBSQLInput // implements SQLInput
7
{
8 /*
9   byte[] sqlValue;
10
11    public DaffodilDBSQLInput(byte[] sqlValue)
12    {
13      sqlValue = this.sqlValue;
14    }
15
16
17     /**
18      * Reads the next attribute in the stream and returns it as a <code>String</code>
19      * in the Java programming language.
20      *
21      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
22      * @exception SQLException if a database access error occurs
23     public String readString() throws SQLException{
24       if(sqlValue == null)
25          return null;
26       return CCzufDpowfsufs.getString(sqlValue);
27     }
28
29     /**
30      * Reads the next attribute in the stream and returns it as a <code>boolean</code>
31      * in the Java programming language.
32      *
33      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>false</code>
34      * @exception SQLException if a database access error occurs
35     public boolean readBoolean() throws SQLException{
36       if(sqlValue == null)
37          return false;
38       return CCzufDpowfsufs.getBoolean(sqlValue).booleanValue();
39     }
40
41     /**
42      * Reads the next attribute in the stream and returns it as a <code>byte</code>
43      * in the Java programming language.
44      *
45      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
46      * @exception SQLException if a database access error occurs
47     public byte readByte() throws SQLException{
48        if(sqlValue == null)
49          return 0;
50        return sqlValue[0];
51     }
52
53     /**
54      * Reads the next attribute in the stream and returns it as a <code>short</code>
55      * in the Java programming language.
56      *
57      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
58      * @exception SQLException if a database access error occurs
59     public short readShort() throws SQLException{
60       if(sqlValue == null)
61          return 0;
62        return CCzufDpowfsufs.getShort(sqlValue).shortValue();
63     }
64
65     /**
66      * Reads the next attribute in the stream and returns it as an <code>int</code>
67      * in the Java programming language.
68      *
69      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
70      * @exception SQLException if a database access error occurs
71     public int readInt() throws SQLException{
72        if(sqlValue == null)
73          return 0;
74        return CCzufDpowfsufs.getInt(sqlValue).intValue();
75     }
76
77     /**
78      * Reads the next attribute in the stream and returns it as a <code>long</code>
79      * in the Java programming language.
80      *
81      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
82      * @exception SQLException if a database access error occurs
83     public long readLong() throws SQLException{
84        if(sqlValue == null)
85          return 0;
86        return CCzufDpowfsufs.getLong(sqlValue).longValue();
87
88     }
89
90     /**
91      * Reads the next attribute in the stream and returns it as a <code>float</code>
92      * in the Java programming language.
93      *
94      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
95      * @exception SQLException if a database access error occurs
96      *
97     public float readFloat() throws SQLException{
98        if(sqlValue == null)
99          return 0;
100        return CCzufDpowfsufs.getFloat(sqlValue).floatValue();
101
102     }
103
104     /**
105      * Reads the next attribute in the stream and returns it as a <code>double</code>
106      * in the Java programming language.
107      *
108      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
109      * @exception SQLException if a database access error occurs
110      *
111     public double readDouble() throws SQLException{
112        if(sqlValue == null)
113          return 0;
114        return CCzufDpowfsufs.getDouble(sqlValue).doubleValue();
115     }
116
117     /**
118      * Reads the next attribute in the stream and returns it as a <code>java.math.BigDecimal</code>
119      * object in the Java programming language.
120      *
121      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
122      * @exception SQLException if a database access error occurs
123      *
124     public java.math.BigDecimal readBigDecimal() throws SQLException{
125        P.pln( " Method not implemented yet" );
126        return null;
127     }
128
129     /**
130      * Reads the next attribute in the stream and returns it as an array of bytes
131      * in the Java programming language.
132      *
133      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
134      * @exception SQLException if a database access error occurs
135      *
136     public byte[] readBytes() throws SQLException{
137       return sqlValue;
138     }
139
140     /**
141      * Reads the next attribute in the stream and returns it as a <code>java.sql.Date</code> object.
142      *
143      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
144      * @exception SQLException if a database access error occurs
145      *
146     public java.sql.Date readDate() throws SQLException{
147       P.pln( " Method not implemented yet" );
148       return null;
149     }
150
151     /**
152      * Reads the next attribute in the stream and returns it as a <code>java.sql.Time</code> object.
153      *
154      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
155      * @exception SQLException if a database access error occurs
156      *
157     public java.sql.Time readTime() throws SQLException{
158        P.pln( " Method not implemented yet" );
159        return null;
160     }
161
162     /**
163      * Reads the next attribute in the stream and returns it as a <code>java.sql.Timestamp</code> object.
164      *
165      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
166      * @exception SQLException if a database access error occurs
167      *
168     public java.sql.Timestamp readTimestamp() throws SQLException{
169        P.pln( " Method not implemented yet" );
170        return null;
171     }
172
173     /**
174      * Reads the next attribute in the stream and returns it as a stream of Unicode characters.
175      *
176      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
177      * @exception SQLException if a database access error occurs
178      *
179     public java.io.Reader readCharacterStream() throws SQLException{
180        P.pln( " Method not implemented yet" );
181        return null;
182     }
183
184     /**
185      * Reads the next attribute in the stream and returns it as a stream of ASCII characters.
186      *
187      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
188      * @exception SQLException if a database access error occurs
189      *
190     public java.io.InputStream readAsciiStream() throws SQLException{
191        P.pln( " Method not implemented yet" );
192        return null;
193     }
194
195     /**
196      * Reads the next attribute in the stream and returns it as a stream of uninterpreted
197      * bytes.
198      *
199      * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
200      * @exception SQLException if a database access error occurs
201      *
202     public java.io.InputStream readBinaryStream() throws SQLException{
203        P.pln( " Method not implemented yet" );
204        return null;
205     }
206
207
208     /**
209      * Reads the datum at the head of the stream and returns it as an
210      * <code>Object</code> in the Java programming language. The
211      * actual type of the object returned is determined by the default type
212      * mapping, and any customizations present in this stream's type map.
213      *
214      * <P>A type map is registered with the stream by the JDBC driver before the
215      * stream is passed to the application.
216      *
217      * <P>When the datum at the head of the stream is an SQL <code>NULL</code>,
218      * the method returns <code>null</code>. If the datum is an SQL structured or distinct
219      * type, it determines the SQL type of the datum at the head of the stream.
220      * If the stream's type map has an entry for that SQL type, the driver
221      * constructs an object of the appropriate class and calls the method
222      * <code>SQLData.readSQL</code> on that object, which reads additional data from the
223      * stream, using the protocol described for that method.
224      *
225      * @return the datum at the head of the stream as an <code>Object</code> in the
226      * Java programming language;<code>null</code> if the datum is SQL <code>NULL</code>
227      * @exception SQLException if a database access error occurs
228      *
229     public Object readObject() throws SQLException{
230       P.pln( " Method not implemented yet" );
231       return null;
232     }
233
234     /**
235      * Reads an SQL <code>REF</code> value from the stream and returns it as a
236      * <code>Ref</code> object in the Java programming language.
237      *
238      * @return a <code>Ref</code> object representing the SQL <code>REF</code> value
239      * at the head of the stream; <code>null</code> if the value read is
240      * SQL <code>NULL</code>
241      * @exception SQLException if a database access error occurs
242      *
243     public Ref readRef() throws SQLException{
244        P.pln( " Method not implemented yet" );
245        return null;
246     }
247
248     /**
249      * Reads an SQL <code>BLOB</code> value from the stream and returns it as a
250      * <code>Blob</code> object in the Java programming language.
251      *
252      * @return a <code>Blob</code> object representing data of the SQL <code>BLOB</code> value
253      * at the head of the stream; <code>null</code> if the value read is
254      * SQL <code>NULL</code>
255      * @exception SQLException if a database access error occurs
256      *
257     public Blob readBlob() throws SQLException{
258       P.pln( " Method not implemented yet" );
259       return null;
260     }
261
262     /**
263      * Reads an SQL <code>CLOB</code> value from the stream and returns it as a
264      * <code>Clob</code> object in the Java programming language.
265      *
266      * @return a <code>Clob</code> object representing data of the SQL <code>CLOB</code> value
267      * at the head of the stream; <code>null</code> if the value read is
268      * SQL <code>NULL</code>
269      * @exception SQLException if a database access error occurs
270      *
271     public Clob readClob() throws SQLException{
272        P.pln( " Method not implemented yet" );
273        return null;
274     }
275
276     /**
277      * Reads an SQL <code>ARRAY</code> value from the stream and returns it as an
278      * <code>Array</code> object in the Java programming language.
279      *
280      * @return an <code>Array</code> object representing data of the SQL
281      * <code>ARRAY</code> value at the head of the stream; <code>null</code>
282      * if the value read is SQL <code>NULL</code>
283      * @exception SQLException if a database access error occurs
284      *
285     public Array readArray() throws SQLException{
286       P.pln( " Method not implemented yet" );
287       return null;
288     }
289
290     /**
291      * Retrieves whether the last value read was SQL <code>NULL</code>.
292      *
293      * @return <code>true</code> if the most recently read SQL value was SQL
294      * <code>NULL</code>; <code>false</code> otherwise
295      * @exception SQLException if a database access error occurs
296      *
297      *
298     public boolean wasNull() throws SQLException{
299       P.pln( " Method not implemented yet" );
300       return false;
301     }
302
303
304     /**
305      * Reads an SQL <code>DATALINK</code> value from the stream and returns it as a
306      * <code>java.net.URL</code> object in the Java programming language.
307      *
308      * @return a <code>java.net.URL</code> object.
309      * @exception SQLException if a database access error occurs
310      * @exception java.net.MalformedURLException if a URL is malformed
311      * @since 1.4
312      *
313     public java.net.URL readURL() throws SQLException{
314        P.pln( " Method not implemented yet" );
315        return null;
316     }
317 */

318
319 }
320
Popular Tags