Source Code Cross Referenced for tinySQLResultSet.java in  » Database-DBMS » TinySQL » com » sqlmagic » tinysql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » TinySQL » com.sqlmagic.tinysql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * The tinySQLResultSet class for the tinySQL JDBC Driver
0003:         *
0004:         * A lot of this code is based on or directly taken from
0005:         * George Reese's (borg@imaginary.com) mSQL driver.
0006:         *
0007:         * So, it's probably safe to say:
0008:         *
0009:         * Portions of this code Copyright (c) 1996 George Reese
0010:         *
0011:         * The rest of it:
0012:         *
0013:         * Copyright 1996, Brian C. Jepson
0014:         *                 (bjepson@ids.net)
0015:         *
0016:         * $Author: davis $
0017:         * $Date: 2004/12/18 21:30:40 $
0018:         * $Revision: 1.1 $
0019:         *
0020:         * This library is free software; you can redistribute it and/or
0021:         * modify it under the terms of the GNU Lesser General Public
0022:         * License as published by the Free Software Foundation; either
0023:         * version 2.1 of the License, or (at your option) any later version.
0024:         *
0025:         * This library is distributed in the hope that it will be useful,
0026:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
0027:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0028:         * Lesser General Public License for more details.
0029:         *
0030:         * You should have received a copy of the GNU Lesser General Public
0031:         * License along with this library; if not, write to the Free Software
0032:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
0033:         */
0034:
0035:        package com.sqlmagic.tinysql;
0036:
0037:        import java.sql.Date;
0038:        import java.math.BigDecimal;
0039:        import java.math.BigInteger;
0040:        import java.sql.ResultSet;
0041:        import java.sql.ResultSetMetaData;
0042:        import java.sql.SQLException;
0043:        import java.sql.SQLWarning;
0044:        import java.sql.Statement;
0045:        import java.sql.Blob;
0046:        import java.sql.Clob;
0047:        import java.sql.Ref;
0048:        import java.sql.Array;
0049:        import java.sql.Time;
0050:        import java.sql.Timestamp;
0051:        import java.sql.Types;
0052:        import java.text.SimpleDateFormat;
0053:        import java.util.Calendar;
0054:        import java.util.Hashtable;
0055:        import java.text.ParsePosition;
0056:
0057:        /**
0058:         * @author Thomas Morgner <mgs@sherito.org> 
0059:         * <ul>
0060:         * <li>tinySQLResultSet now holds a reference
0061:         * to statement which created it. If the resultset was not created by an statement,
0062:         * <code>null</code> is returned (f.i. used in DatabaseMetaData-Queries).  
0063:         * <li>Changed the code to support setting a fetchsize for queries.
0064:         * <li>Parsing of dates corrected to format yyyyMMdd
0065:         * <li>Now supporting the FetchDirection methods, getType().
0066:         * <li>Concurrency is not returned as CONCUR_READ_ONLY as lowest common standard.
0067:         * <li>getColumnTypes returns now values given in tsResultSet and does not try to
0068:         * guess from strings.
0069:         * </ul>
0070:         */
0071:        public class tinySQLResultSet implements  java.sql.ResultSet {
0072:
0073:            // The Statement that created this resultset
0074:            private tinySQLStatement statement = (tinySQLStatement) null;
0075:            private tinySQLPreparedStatement preparedStatement = (tinySQLPreparedStatement) null;
0076:
0077:            /**
0078:             *
0079:             * The tsResultSet
0080:             * 
0081:             */
0082:            private tsResultSet result;
0083:
0084:            /**
0085:             *
0086:             * A tsRow object to hold the current row
0087:             *
0088:             */
0089:            private tsRow current_row;
0090:
0091:            /**
0092:             *
0093:             * The index of the current row
0094:             *
0095:             */
0096:            private int current_row_index = 0;
0097:
0098:            /**
0099:             *
0100:             * The meta data for this result set.
0101:             *
0102:             */
0103:            private tinySQLResultSetMetaData meta;
0104:
0105:            /**
0106:             *
0107:             * A Hashtable that maps column names to columns
0108:             *
0109:             */
0110:            private Hashtable column_map = null;
0111:
0112:            /**
0113:             *
0114:             * Given a tsResultSet, this will construct a new tinySQLResultSet
0115:             * @param res the tsResultSet from a query
0116:             *
0117:             */
0118:            public tinySQLResultSet(tsResultSet res,
0119:                    tinySQLStatement inputStatement) {
0120:                result = res;
0121:                this .statement = inputStatement;
0122:            }
0123:
0124:            public tinySQLResultSet(tsResultSet res,
0125:                    tinySQLPreparedStatement inputStatement) {
0126:                result = res;
0127:                this .preparedStatement = inputStatement;
0128:            }
0129:
0130:            /**
0131:             *
0132:             * Advance to the next row in the result set. 
0133:             * @see java.sql.ResultSet#next
0134:             * @exception SQLException thrown in case of error
0135:             * @return true if there are any more rows to process, otherwise false.
0136:             *
0137:             */
0138:            public synchronized boolean next() throws SQLException {
0139:
0140:                try {
0141:
0142:                    // automatically return false if the
0143:                    // result set is empty
0144:                    //
0145:                    if (result.size() < 1) {
0146:                        return false;
0147:                    }
0148:
0149:                    // increment the current row index
0150:                    //
0151:                    current_row_index++;
0152:                    // retrieve the row at the current_row_index and store
0153:                    // it in the current_row field.
0154:                    //
0155:                    current_row = result.rowAt(current_row_index - 1);
0156:
0157:                    // If no rows was retrieved, return false to indicate
0158:                    // that there are no more results.
0159:                    if (current_row == null) {
0160:                        return false;
0161:                    }
0162:                    return true;
0163:
0164:                } catch (Exception e) {
0165:                    throw new SQLException(e.getMessage());
0166:                }
0167:
0168:            }
0169:
0170:            /**
0171:             *
0172:             * Provides a method to close a ResultSet
0173:             * 
0174:             * @see java.sql.ResultSet#close
0175:             *
0176:             */
0177:            public void close() throws SQLException {
0178:            }
0179:
0180:            /**
0181:             *
0182:             * Returns whether or not the last column read was null.
0183:             * tinySQL doesn't have nulls, so this is inconsequential...
0184:             * @see java.sql.ResultSet#wasNull
0185:             * @return true if the column was null, false otherwise
0186:             *
0187:             */
0188:            public boolean wasNull() throws SQLException {
0189:                return false;
0190:            }
0191:
0192:            /**
0193:             * 
0194:             * Gets the value of a column (by index) as a String.
0195:             * @see java.sql.ResultSet#getString
0196:             * @exception SQLException thrown for bogus column index
0197:             * @param column the column index
0198:             * @return the column's String value
0199:             *
0200:             */
0201:            public String getString(int column) throws SQLException {
0202:                String columnValue;
0203:                // retrieve the column at the specified index. tinySQL
0204:                // has a column offset of zero, while JDBC uses one.
0205:                // Because of this, I need to subtract one from the
0206:                // index to get the tinySQL index.
0207:                //
0208:                if (current_row == (tsRow) null)
0209:                    return (String) null;
0210:                tsColumn col = result.columnAtIndex(column - 1);
0211:
0212:                // return the column's value
0213:                //
0214:                columnValue = current_row.columnAsString(col);
0215:                /*
0216:                 *  Reformat date columns to YYYY-MM-DD - this is standard default
0217:                 *  Java format for getString on Date columns. 
0218:                 */
0219:                if (Utils.isDateColumn(col.type))
0220:                    columnValue = UtilString.toStandardDate(columnValue);
0221:                return columnValue;
0222:            }
0223:
0224:            /**
0225:             *
0226:             * Get the value of a column in the current row as a Java byte.
0227:             *
0228:             * @param columnIndex the first column is 1, the second is 2, ...
0229:             * @return the column value
0230:             *
0231:             */
0232:            public byte getByte(int column) throws SQLException {
0233:
0234:                // get the column as a string
0235:                //
0236:                String str = getString(column);
0237:
0238:                // if it's a blank string, return 0,
0239:                // otherwise, cast the first character 
0240:                // in the string to byte and return it.
0241:                //
0242:                if (str.equals("")) {
0243:                    return 0;
0244:                } else {
0245:                    return (byte) str.charAt(0);
0246:                }
0247:
0248:            }
0249:
0250:            /**
0251:             *
0252:             * Get the value of a column in the current row as boolean
0253:             * @see java.sql.ResultSet#getBoolean
0254:             * @exception SQLException Harum Scarum's coming down fast, Clay...
0255:             * @param column the column index
0256:             * @return false for "", null, or "0"; true otherwise
0257:             */
0258:            public boolean getBoolean(int column) throws SQLException {
0259:
0260:                try {
0261:
0262:                    // get the column as a string
0263:                    //
0264:                    String str = getString(column);
0265:
0266:                    // a blank string is false
0267:                    //
0268:                    if (str.equals(""))
0269:                        return false;
0270:
0271:                    // a zero is false
0272:                    //
0273:                    if (str.equals("0"))
0274:                        return false;
0275:
0276:                    // nothing is true... everything is permitted
0277:                    //
0278:                    return true;
0279:
0280:                } catch (Exception e) {
0281:                    throw new SQLException(e.getMessage());
0282:                }
0283:            }
0284:
0285:            /**
0286:             *
0287:             * Get the value of a column in the current row as a short.
0288:             * @see java.sql.ResultSet#getShort
0289:             * @exception SQLException D'ohh!
0290:             * @param column the column being retrieved
0291:             * @return the column as a short
0292:             *
0293:             */
0294:            public short getShort(int column) throws SQLException {
0295:
0296:                // get the column as a string
0297:                //
0298:                String str = getString(column);
0299:
0300:                // if it's null, return 0
0301:                //
0302:                if (str == null)
0303:                    return 0;
0304:
0305:                // try to convert it to an integer, and cast it to short
0306:                //
0307:                try {
0308:                    return (short) (Integer.valueOf(str.trim()).intValue());
0309:                } catch (NumberFormatException e) {
0310:                    throw new SQLException("tinySQL invalid short Number: "
0311:                            + e.getMessage());
0312:                }
0313:            }
0314:
0315:            /**
0316:             *
0317:             * Retrieve a column from the current row as an int
0318:             * @see java.sql.ResultSet#getInt
0319:             * @exception SQLException bad things... the wind began to howl...
0320:             * @param column the column being retrieved
0321:             * @return the column as an integer
0322:             *
0323:             */
0324:            public int getInt(int column) throws SQLException {
0325:                int dotAt;
0326:
0327:                // get the column as a string
0328:                //
0329:                String str = getString(column);
0330:
0331:                // if it's null, return Integer.MIN_VALUE
0332:                //
0333:                if (str == null)
0334:                    return Integer.MIN_VALUE;
0335:
0336:                // try to convert this string to integer
0337:                //
0338:                dotAt = str.indexOf(".");
0339:                if (dotAt > -1)
0340:                    str = str.substring(0, dotAt);
0341:                try {
0342:                    return Integer.valueOf(str.trim()).intValue();
0343:                } catch (NumberFormatException e) {
0344:                    return Integer.MIN_VALUE;
0345:                }
0346:            }
0347:
0348:            /**
0349:             * 
0350:             * Get the value of a column in the current row as a long
0351:             * @see java.sql.ResultSet#getLong
0352:             * @exception SQLException in case of an error
0353:             * @param column the column being retrieved
0354:             * @return the column as a long
0355:             *
0356:             */
0357:            public long getLong(int column) throws SQLException {
0358:
0359:                // get the column as a string
0360:                //
0361:                String str = getString(column);
0362:
0363:                // it it's null, return 0
0364:                if (str == null)
0365:                    return 0;
0366:
0367:                // try to convert the String to a long
0368:                //
0369:                try {
0370:                    return Long.valueOf(str.trim()).longValue();
0371:                } catch (NumberFormatException e) {
0372:                    throw new SQLException("tinySQL invalid Long Number: "
0373:                            + e.getMessage());
0374:                }
0375:            }
0376:
0377:            /**
0378:             *
0379:             * Return a column as a float.
0380:             * @see java.sql.ResultSet#getFloat
0381:             * @exception SQLException in case of error
0382:             * @param column the column being retrieved
0383:             * @return the column as a float
0384:             *
0385:             */
0386:            public float getFloat(int column) throws SQLException {
0387:
0388:                // get the column as a string
0389:                //
0390:                String str = getString(column);
0391:
0392:                // if it's null, assume zero
0393:                //
0394:                if (str == null)
0395:                    return 0;
0396:
0397:                // try to perform the conversion
0398:                //
0399:                try {
0400:                    return Float.valueOf(str.trim()).floatValue();
0401:                } catch (NumberFormatException e) {
0402:                    throw new SQLException("Invalid Number: " + e.getMessage());
0403:                }
0404:            }
0405:
0406:            /**
0407:             *
0408:             * Return a column as a double
0409:             * @see java.sql.ResultSet#getDouble
0410:             * @exception SQLException in case of error
0411:             * @param column the column being retrieved
0412:             * @return the column as a double
0413:             *
0414:             */
0415:            public double getDouble(int column) throws SQLException {
0416:
0417:                // get the column as a string
0418:                //
0419:                String str = getString(column);
0420:
0421:                // it it's null, return zero
0422:                //
0423:                if (str == null)
0424:                    return 0;
0425:
0426:                // attempt the conversion
0427:                //
0428:                try {
0429:                    return Double.valueOf(str.trim()).doubleValue();
0430:                } catch (NumberFormatException e) {
0431:                    throw new SQLException("tinySQL invalid double Number: "
0432:                            + e.getMessage());
0433:                }
0434:            }
0435:
0436:            /**
0437:             *
0438:             * Return a column as a BigDecimal object
0439:             * @see java.sql.ResultSet#getBigDecimal
0440:             * @exception SQLException in case of a problem
0441:             * @param column the column being retrieved
0442:             * @param scale the number of digits to the right of the decimal
0443:             * @return the column as a BigDecimal
0444:             * @deprecated
0445:             */
0446:            public BigDecimal getBigDecimal(int column, int scale)
0447:                    throws SQLException {
0448:
0449:                // get the column as a string
0450:                //
0451:                String str = getString(column);
0452:
0453:                // return null as zero, otherwise use the string
0454:                //
0455:                if (str == null)
0456:                    return new BigDecimal(new BigInteger("0"), scale);
0457:                else
0458:                    return new BigDecimal(new BigInteger(str.trim()), scale);
0459:            }
0460:
0461:            /**
0462:             *
0463:             * Get the value of a column in the current row as a Java byte array.
0464:             * @see java.sql.ResultSet#getBytes
0465:             * @exception SQLException thrown in case of trouble
0466:             * @param column the column being retrieved
0467:             * @return a byte array that is the value of the column
0468:             *
0469:             */
0470:            public byte[] getBytes(int column) throws SQLException {
0471:
0472:                // get the column as a string
0473:                //
0474:                String str = getString(column);
0475:
0476:                if (str == null)
0477:                    return null;
0478:                try {
0479:                    return str.getBytes(str);
0480:                } catch (java.io.UnsupportedEncodingException e) {
0481:                    throw new java.sql.SQLException("Bad bytes!: "
0482:                            + e.getMessage());
0483:                }
0484:
0485:            }
0486:
0487:            /**
0488:             *
0489:             * Get the value of a column in the current row as a java.sql.Date object.
0490:             * @see java.sqlResultSet#getDate
0491:             * @exception SQLException thrown in case of error
0492:             * @param column the column being retrieved
0493:             * @return the java.sql.Date object for the column
0494:             *
0495:             */
0496:            public java.sql.Date getDate(int column) throws SQLException {
0497:
0498:                // get the column as a string in the format YYYY-MM-DD
0499:                //
0500:                String str;
0501:                str = getString(column);
0502:
0503:                // return null if the string is null
0504:                //
0505:                if (str == null)
0506:                    return null;
0507:
0508:                // try to use the string to instantiate a java.util.Date object,
0509:                // then use that object to instantiate a java.sql.Date object.
0510:                //
0511:                try {
0512:                    SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
0513:                    java.util.Date d = fmt.parse(str, new ParsePosition(0));
0514:
0515:                    return new java.sql.Date(d.getTime());
0516:
0517:                } catch (Exception e) {
0518:                    throw new SQLException("Date format error: "
0519:                            + e.getMessage());
0520:                }
0521:
0522:            }
0523:
0524:            /**
0525:             *
0526:             * Get the value of a column in the current row as a java.sql.Time object.
0527:             *
0528:             * @see java.sql.ResultSet#getTime
0529:             * @exception SQLException thrown in the event of troubles
0530:             * @param column the column being retrieved
0531:             * @return the column as a java.sql.Time object
0532:             *
0533:             */
0534:            public java.sql.Time getTime(int column) throws SQLException {
0535:
0536:                // get the column as a string
0537:                //
0538:                String str = getString(column);
0539:
0540:                // if the string is null, return null
0541:                //
0542:                if (str == null)
0543:                    return null;
0544:
0545:                // try to use the string to instantiate a java.util.Date object,
0546:                // then use that object to instantiate a java.sql.Time object.
0547:                //
0548:                try {
0549:
0550:                    SimpleDateFormat fmt = new SimpleDateFormat(
0551:                            "EEE MMM dd hh:mm:ss z yyyy");
0552:                    java.util.Date d = fmt.parse(str, new ParsePosition(0));
0553:
0554:                    return new java.sql.Time(d.getTime());
0555:
0556:                } catch (Exception e) {
0557:                    throw new SQLException("Data format error: "
0558:                            + e.getMessage());
0559:                }
0560:            }
0561:
0562:            /**
0563:             * Get the value of a column in the current row as a java.sql.Timestamp
0564:             * @see java.sql.ResultSet#getTimestamp
0565:             * @exception SQLException thrown in the event of troubles
0566:             * @param column the column being retrieved
0567:             * @return the column as a java.sql.Timestamp object
0568:             */
0569:            public java.sql.Timestamp getTimestamp(int column)
0570:                    throws SQLException {
0571:
0572:                // get the column as a string
0573:                //
0574:                String str = getString(column);
0575:
0576:                // if the string is null, return null
0577:                //
0578:                if (str == null)
0579:                    return null;
0580:
0581:                // try to use the string to instantiate a java.util.Date object,
0582:                // then use that object to instantiate a java.sql.Timestamp object.
0583:                //
0584:                try {
0585:
0586:                    SimpleDateFormat fmt = new SimpleDateFormat(
0587:                            "EEE MMM dd hh:mm:ss z yyyy");
0588:                    java.util.Date d = fmt.parse(str, new ParsePosition(0));
0589:
0590:                    return new java.sql.Timestamp(d.getTime());
0591:
0592:                } catch (Exception e) {
0593:                    throw new SQLException("Data format error: "
0594:                            + e.getMessage());
0595:                }
0596:
0597:            }
0598:
0599:            /**
0600:             *
0601:             * This is not currently supported.
0602:             *
0603:             */
0604:            public java.io.InputStream getAsciiStream(int column)
0605:                    throws SQLException {
0606:                return null;
0607:            }
0608:
0609:            /**
0610:             *
0611:             * This is not currently supported.
0612:             * @deprecated
0613:             *
0614:             */
0615:            public java.io.InputStream getUnicodeStream(int column)
0616:                    throws SQLException {
0617:                return null;
0618:            }
0619:
0620:            /**
0621:             *
0622:             * This is not currently supported.
0623:             *
0624:             */
0625:            public java.io.InputStream getBinaryStream(int column)
0626:                    throws SQLException {
0627:                return null;
0628:            }
0629:
0630:            /**
0631:             *
0632:             * Get the name of the cursor corresponding to this result set.
0633:             * This has to meaning to tinySQL
0634:             * @see java.sql.ResultSet#getCursorName
0635:             * @return ""
0636:             *
0637:             */
0638:            public String getCursorName() throws SQLException {
0639:                return "";
0640:            }
0641:
0642:            /**
0643:             *
0644:             * Returns a ResultSetMetaData object for this result set
0645:             * @see java.sql.ResultSet#getMetaData
0646:             * @exception SQLException thrown on error getting meta-data
0647:             * @return ResultSetMetaData object containing result set info
0648:             *
0649:             */
0650:            public ResultSetMetaData getMetaData() throws SQLException {
0651:
0652:                // if we didn't instantiate a meta data object, then
0653:                // do so. Since it's a field of this object, and
0654:                // not private to this method, it will stay around
0655:                // between calls to this method.
0656:                //
0657:                if (meta == null) {
0658:                    meta = new tinySQLResultSetMetaData(result);
0659:                }
0660:
0661:                // return the ResultSetMetaData object
0662:                //
0663:                return meta;
0664:            }
0665:
0666:            /**
0667:             *
0668:             * Retrieves data as objects
0669:             * @see java.sql.ResultSet#getObject
0670:             * @exception SQLException in the event of an error
0671:             * @param column the column desired
0672:             * @param type the SQL data type of the field
0673:             * @scale precision for BigDecimals
0674:             * @return the column specified as an Object
0675:             *
0676:             */
0677:            public Object getObject(int column, int type, int scale)
0678:                    throws SQLException {
0679:
0680:                switch (type) {
0681:                case Types.BIT:
0682:                    return new Boolean(getBoolean(column));
0683:
0684:                case Types.TINYINT:
0685:                    return new Character((char) getInt(column));
0686:
0687:                case Types.SMALLINT:
0688:                    return new Integer(getShort(column));
0689:
0690:                case Types.INTEGER:
0691:                    return new Integer(getInt(column));
0692:
0693:                case Types.BIGINT:
0694:                    return new Long(getLong(column));
0695:
0696:                case Types.FLOAT:
0697:                    return new Float(getFloat(column));
0698:
0699:                case Types.REAL:
0700:                    return new Float(getFloat(column));
0701:
0702:                case Types.DOUBLE:
0703:                    return new Double(getDouble(column));
0704:
0705:                case Types.NUMERIC:
0706:                    return getBigDecimal(column, scale);
0707:
0708:                case Types.DECIMAL:
0709:                    return getBigDecimal(column, scale);
0710:
0711:                case Types.CHAR:
0712:                    return getString(column);
0713:
0714:                case Types.VARCHAR:
0715:                    return getString(column);
0716:
0717:                case Types.LONGVARCHAR:
0718:                    return getString(column);
0719:
0720:                case Types.DATE:
0721:                    return getDate(column);
0722:
0723:                case Types.TIME:
0724:                    return getTime(column);
0725:
0726:                case Types.TIMESTAMP:
0727:                    return getTimestamp(column);
0728:
0729:                case Types.BINARY:
0730:                    return getBytes(column);
0731:
0732:                case Types.VARBINARY:
0733:                    return getBytes(column);
0734:
0735:                case Types.LONGVARBINARY:
0736:                    return getBytes(column);
0737:
0738:                default:
0739:                    return null;
0740:                }
0741:            }
0742:
0743:            /**
0744:             *
0745:             * Same as above, except with a default scale to 0.
0746:             *
0747:             */
0748:            public Object getObject(int column, int type) throws SQLException {
0749:                return getObject(column, type, 0);
0750:            }
0751:
0752:            /**
0753:             *
0754:             * Same as above, except using the column's default SQL type.
0755:             *
0756:             */
0757:            public Object getObject(int column) throws SQLException {
0758:                ResultSetMetaData meta = getMetaData();
0759:                int type = meta.getColumnType(column);
0760:
0761:                return getObject(column, type);
0762:            }
0763:
0764:            /**
0765:             *
0766:             * Return the String value of a column given its name, rather than
0767:             * its index.
0768:             * @see java.sql.ResultSet#getString
0769:             * @param name the name of the column desired
0770:             * @return the value of the column as a String
0771:             *
0772:             */
0773:            public String getString(String name) throws SQLException {
0774:
0775:                return getString(findColumn(name));
0776:
0777:            }
0778:
0779:            /**
0780:             *
0781:             * Returns the column as a byte based on column name
0782:             *
0783:             */
0784:            public byte getByte(String columnName) throws SQLException {
0785:
0786:                return getByte(findColumn(columnName));
0787:
0788:            }
0789:
0790:            /**
0791:             *
0792:             * Get the value of a boolean column in the current row
0793:             * @param columnName is the SQL name of the column
0794:             * @return the column value; if isNull the value is false
0795:             *
0796:             */
0797:            public boolean getBoolean(String columnName) throws SQLException {
0798:
0799:                return getBoolean(findColumn(columnName));
0800:
0801:            }
0802:
0803:            /**
0804:             *
0805:             * Get the value of a short by column name
0806:             * @param columnName is the SQL name of the column
0807:             * @return the column value; if isNull the value is 0
0808:             *
0809:             */
0810:            public short getShort(String columnName) throws SQLException {
0811:
0812:                return getShort(findColumn(columnName));
0813:
0814:            }
0815:
0816:            /**
0817:             *
0818:             * Get the integer value of a column by name
0819:             * @param columnName is the SQL name of the column
0820:             * @return the column value; if isNull the value is 0
0821:             *
0822:             */
0823:            public int getInt(String columnName) throws SQLException {
0824:
0825:                return getInt(findColumn(columnName));
0826:
0827:            }
0828:
0829:            /**
0830:             *
0831:             * Get the long value of a column by name
0832:             * @param columnName is the SQL name of the column
0833:             * @return the column value; if isNull the value is 0
0834:             *
0835:             */
0836:            public long getLong(String columnName) throws SQLException {
0837:
0838:                return getLong(findColumn(columnName));
0839:
0840:            }
0841:
0842:            /**
0843:             *
0844:             * Get the float value of a column by name
0845:             * @param columnName is the SQL name of the column
0846:             * @return the column value; if isNull the value is 0
0847:             *
0848:             */
0849:            public float getFloat(String columnName) throws SQLException {
0850:
0851:                return getFloat(findColumn(columnName));
0852:
0853:            }
0854:
0855:            /**
0856:             *
0857:             * Get the double value of a named column
0858:             * @param columnName is the SQL name of the column
0859:             * @return the column value; if isNull the value is 0
0860:             *
0861:             */
0862:            public double getDouble(String columnName) throws SQLException {
0863:
0864:                return getDouble(findColumn(columnName));
0865:
0866:            }
0867:
0868:            /**
0869:             *
0870:             * Get the value of a named column as a BigDecimal object
0871:             * @param columnName is the SQL name of the column
0872:             * @return the column value; if isNull the value is null
0873:             * @deprecated
0874:             */
0875:            public BigDecimal getBigDecimal(String columnName, int scale)
0876:                    throws SQLException {
0877:
0878:                return getBigDecimal(findColumn(columnName), scale);
0879:
0880:            }
0881:
0882:            /**
0883:             *
0884:             * Get the value of a named column as a byte array
0885:             * @param columnName is the SQL name of the column
0886:             * @return the column value; if isNull the value is null
0887:             *
0888:             */
0889:            public byte[] getBytes(String columnName) throws SQLException {
0890:
0891:                return getBytes(findColumn(columnName));
0892:
0893:            }
0894:
0895:            /**
0896:             *
0897:             * Get a named column as a java.sql.Date 
0898:             * @param columnName is the SQL name of the column
0899:             * @return the column value; if isNull the value is null
0900:             *
0901:             */
0902:            public java.sql.Date getDate(String columnName) throws SQLException {
0903:
0904:                return getDate(findColumn(columnName));
0905:
0906:            }
0907:
0908:            /**
0909:             *
0910:             * Get a named column as a java.sql.Time 
0911:             * @param columnName is the SQL name of the column
0912:             * @return the column value; if isNull the value is null
0913:             *
0914:             */
0915:            public java.sql.Time getTime(String columnName) throws SQLException {
0916:
0917:                return getTime(findColumn(columnName));
0918:
0919:            }
0920:
0921:            /**
0922:             *
0923:             * Get a named column as a java.sql.Time 
0924:             * @param columnName is the SQL name of the column
0925:             * @return the column value; if isNull the value is null
0926:             *
0927:             */
0928:            public java.sql.Timestamp getTimestamp(String columnName)
0929:                    throws SQLException {
0930:
0931:                return getTimestamp(findColumn(columnName));
0932:
0933:            }
0934:
0935:            /**
0936:             * 
0937:             * This is unsupported, but we'll try to call the corresponding
0938:             * call by column index.
0939:             *
0940:             */
0941:            public java.io.InputStream getAsciiStream(String columnName)
0942:                    throws SQLException {
0943:
0944:                return getAsciiStream(findColumn(columnName));
0945:
0946:            }
0947:
0948:            /**
0949:             * 
0950:             * This is unsupported, but we'll try to call the corresponding
0951:             * call by column index.
0952:             * @deprecated
0953:             *
0954:             */
0955:            public java.io.InputStream getUnicodeStream(String columnName)
0956:                    throws SQLException {
0957:
0958:                return getUnicodeStream(findColumn(columnName));
0959:
0960:            }
0961:
0962:            /**
0963:             * 
0964:             * This is unsupported, but we'll try to call the corresponding
0965:             * call by column index.
0966:             *
0967:             */
0968:            public java.io.InputStream getBinaryStream(String columnName)
0969:                    throws SQLException {
0970:
0971:                return getBinaryStream(findColumn(columnName));
0972:
0973:            }
0974:
0975:            /**
0976:             *
0977:             * Get the value of a named column as an object
0978:             * @param columnName the SQL column name
0979:             * @param sqlType SQL type code defined by java.sql.Types
0980:             * @return the parameter as an Object
0981:             *
0982:             */
0983:            public Object getObject(String columnName, int sqlType, int scale)
0984:                    throws SQLException {
0985:
0986:                return getObject(findColumn(columnName), sqlType, scale);
0987:
0988:            }
0989:
0990:            /**
0991:             *
0992:             * Same as above, except defaulting scale to 0.
0993:             *
0994:             */
0995:            public Object getObject(String columnName, int type)
0996:                    throws SQLException {
0997:
0998:                return getObject(findColumn(columnName), type, 0);
0999:
1000:            }
1001:
1002:            /**
1003:             *
1004:             * Same as above, except returning the default SQL type
1005:             *
1006:             */
1007:            public Object getObject(String columnName) throws SQLException {
1008:                return getObject(findColumn(columnName));
1009:            }
1010:
1011:            /**
1012:             *
1013:             * Given a column name, this method returns the column number for that
1014:             * name.  Column name to number mappings are kept inside a Hashtable.
1015:             * Applications that do not need the overhead of this calculation are
1016:             * not penalized since the mapping only occurs on the first attempt to
1017:             * access a column number by name.
1018:             * @exception java.sql.SQLException thrown if a bad name is passed
1019:             * @param name the name of the column desired
1020:             * @return the column number, 1 being the first column
1021:             *
1022:             */
1023:            public int findColumn(String name) throws SQLException {
1024:
1025:                Integer num;
1026:
1027:                // does the column map exist?
1028:                //
1029:                if (column_map == null) {
1030:
1031:                    int i, maxi;
1032:                    String columnIndexName;
1033:
1034:                    // create a Hashtable which expects to hold
1035:                    // enough objects for all the columns in the
1036:                    // result set.
1037:                    //
1038:                    column_map = new Hashtable(maxi = result.numcols());
1039:
1040:                    // add each column by name, with an Integer index
1041:                    //
1042:                    for (i = 0; i < maxi; i++) {
1043:                        tsColumn tsc = result.columnAtIndex(i);
1044:                        columnIndexName = tsc.name;
1045:                        if (tsc.alias != (String) null)
1046:                            columnIndexName = tsc.alias;
1047:                        column_map.put(columnIndexName, new Integer(i));
1048:                    }
1049:                }
1050:
1051:                // one way or another, we've got a column_map; either it
1052:                // already existed, or the above code created it.
1053:                //
1054:
1055:                // look up the column name in the map, and find it's
1056:                // index (the Integer object)
1057:                //
1058:                num = (Integer) column_map.get(name);
1059:                if (num == null) {
1060:                    throw new SQLException("Invalid column name: " + name);
1061:                }
1062:
1063:                // return the column index as an int
1064:                //
1065:                return num.intValue() + 1;
1066:
1067:            }
1068:
1069:            /**
1070:             *
1071:             * Return the warning chain. This is presently unsupported.
1072:             * @see java.sql.Statement#getWarnings
1073:             * @return the chain of warnings
1074:             *
1075:             */
1076:            public SQLWarning getWarnings() throws SQLException {
1077:                return null;
1078:            }
1079:
1080:            /**
1081:             *
1082:             * Clear the chain of warnings. This does nothing, since the
1083:             * warning chain is not used by tinySQL
1084:             * @see java.sql.Statement#clearWarnings
1085:             *
1086:             */
1087:            public void clearWarnings() throws SQLException {
1088:            }
1089:
1090:            //--------------------------JDBC 2.0-----------------------------------
1091:
1092:            //---------------------------------------------------------------------
1093:            // Getter's and Setter's
1094:            //---------------------------------------------------------------------
1095:
1096:            /**
1097:             * JDBC 2.0
1098:             *
1099:             * <p>Gets the value of a column in the current row as a java.io.Reader.
1100:             * @param columnIndex the first column is 1, the second is 2, ...
1101:             */
1102:            public java.io.Reader getCharacterStream(int columnIndex)
1103:                    throws SQLException {
1104:                return null;
1105:            }
1106:
1107:            /**
1108:             * JDBC 2.0
1109:             *
1110:             * <p>Gets the value of a column in the current row as a java.io.Reader.
1111:             * @param columnName the name of the column
1112:             * @return the value in the specified column as a <code>java.io.Reader</code>
1113:             */
1114:            public java.io.Reader getCharacterStream(String columnName)
1115:                    throws SQLException {
1116:                return null;
1117:            }
1118:
1119:            /**
1120:             * JDBC 2.0
1121:             *
1122:             * Gets the value of a column in the current row as a java.math.BigDecimal 
1123:             * object with full precision.
1124:             *
1125:             * @param columnIndex the first column is 1, the second is 2, ...
1126:             * @return the column value (full precision); if the value is SQL NULL, 
1127:             * the result is null
1128:             * @exception SQLException if a database access error occurs
1129:             */
1130:            public BigDecimal getBigDecimal(int columnIndex)
1131:                    throws SQLException {
1132:                return null;
1133:            }
1134:
1135:            /**
1136:             * JDBC 2.0
1137:             *
1138:             * Gets the value of a column in the current row as a java.math.BigDecimal 
1139:             * object with full precision.
1140:             * @param columnName the column name
1141:             * @return the column value (full precision); if the value is SQL NULL, 
1142:             * the result is null
1143:             * @exception SQLException if a database access error occurs
1144:             *
1145:             */
1146:            public BigDecimal getBigDecimal(String columnName)
1147:                    throws SQLException {
1148:                return null;
1149:            }
1150:
1151:            //---------------------------------------------------------------------
1152:            // Traversal/Positioning
1153:            //---------------------------------------------------------------------
1154:
1155:            /**
1156:             * JDBC 2.0
1157:             *
1158:             * <p>Indicates whether the cursor is before the first row in the result 
1159:             * set.   
1160:             *
1161:             * @return true if the cursor is before the first row, false otherwise. Returns
1162:             * false when the result set contains no rows.
1163:             * @exception SQLException if a database access error occurs
1164:             */
1165:            public boolean isBeforeFirst() throws SQLException {
1166:                return false;
1167:            }
1168:
1169:            /**
1170:             * JDBC 2.0
1171:             *
1172:             * <p>Indicates whether the cursor is after the last row in the result 
1173:             * set.   
1174:             *
1175:             * @return true if the cursor is  after the last row, false otherwise.  Returns
1176:             * false when the result set contains no rows.
1177:             * @exception SQLException if a database access error occurs
1178:             */
1179:            public boolean isAfterLast() throws SQLException {
1180:                return false;
1181:            }
1182:
1183:            /**
1184:             * JDBC 2.0
1185:             *
1186:             * <p>Indicates whether the cursor is on the first row of the result set.   
1187:             *
1188:             * @return true if the cursor is on the first row, false otherwise.   
1189:             * @exception SQLException if a database access error occurs
1190:             */
1191:            public boolean isFirst() throws SQLException {
1192:                return false;
1193:            }
1194:
1195:            /**
1196:             * JDBC 2.0
1197:             *
1198:             * <p>Indicates whether the cursor is on the last row of the result set.   
1199:             * Note: Calling the method <code>isLast</code> may be expensive
1200:             * because the JDBC driver
1201:             * might need to fetch ahead one row in order to determine 
1202:             * whether the current row is the last row in the result set.
1203:             *
1204:             * @return true if the cursor is on the last row, false otherwise. 
1205:             * @exception SQLException if a database access error occurs
1206:             */
1207:            public boolean isLast() throws SQLException {
1208:                return false;
1209:            }
1210:
1211:            /**
1212:             * JDBC 2.0
1213:             *
1214:             * <p>Moves the cursor to the front of the result set, just before the
1215:             * first row. Has no effect if the result set contains no rows.
1216:             *
1217:             * @exception SQLException if a database access error occurs or the 
1218:             * result set type is TYPE_FORWARD_ONLY
1219:             */
1220:            public void beforeFirst() throws SQLException {
1221:                return;
1222:            }
1223:
1224:            /**
1225:             * JDBC 2.0
1226:             *
1227:             * <p>Moves the cursor to the end of the result set, just after the last
1228:             * row.  Has no effect if the result set contains no rows.
1229:             *
1230:             * @exception SQLException if a database access error occurs or the 
1231:             * result set type is TYPE_FORWARD_ONLY 
1232:             */
1233:            public void afterLast() throws SQLException {
1234:                return;
1235:            }
1236:
1237:            /**
1238:             * JDBC 2.0
1239:             *
1240:             * <p>Moves the cursor to the first row in the result set.  
1241:             *
1242:             * @return true if the cursor is on a valid row; false if
1243:             *         there are no rows in the result set
1244:             * @exception SQLException if a database access error occurs or the 
1245:             * result set type is TYPE_FORWARD_ONLY
1246:             */
1247:            public boolean first() throws SQLException {
1248:                return false;
1249:            }
1250:
1251:            /**
1252:             * JDBC 2.0
1253:             *
1254:             * <p>Moves the cursor to the last row in the result set.  
1255:             *
1256:             * @return true if the cursor is on a valid row;
1257:             * false if there are no rows in the result set
1258:             * @exception SQLException if a database access error occurs or the
1259:             * result set type is TYPE_FORWARD_ONLY.
1260:             */
1261:            public boolean last() throws SQLException {
1262:                return false;
1263:            }
1264:
1265:            /**
1266:             * JDBC 2.0
1267:             *
1268:             * <p>Retrieves the current row number.  The first row is number 1, the
1269:             * second number 2, and so on.  
1270:             *
1271:             * @return the current row number; 0 if there is no current row
1272:             * @exception SQLException if a database access error occurs
1273:             */
1274:            public int getRow() throws SQLException {
1275:                return 0;
1276:            }
1277:
1278:            /**
1279:             * JDBC 2.0
1280:             *
1281:             * <p>Moves the cursor to the given row number in the result set.
1282:             *
1283:             * <p>If the row number is positive, the cursor moves to 
1284:             * the given row number with respect to the
1285:             * beginning of the result set.  The first row is row 1, the second
1286:             * is row 2, and so on. 
1287:             *
1288:             * <p>If the given row number is negative, the cursor moves to
1289:             * an absolute row position with respect to
1290:             * the end of the result set.  For example, calling
1291:             * <code>absolute(-1)</code> positions the 
1292:             * cursor on the last row, <code>absolute(-2)</code> indicates the next-to-last
1293:             * row, and so on.
1294:             *
1295:             * <p>An attempt to position the cursor beyond the first/last row in
1296:             * the result set leaves the cursor before/after the first/last
1297:             * row, respectively.
1298:             *
1299:             * <p>Note: Calling <code>absolute(1)</code> is the same
1300:             * as calling <code>first()</code>.
1301:             * Calling <code>absolute(-1)</code> is the same as calling <code>last()</code>.
1302:             *
1303:             * @return true if the cursor is on the result set; false otherwise
1304:             * @exception SQLException if a database access error occurs or 
1305:             * row is 0, or result set type is TYPE_FORWARD_ONLY.
1306:             */
1307:            public boolean absolute(int row) throws SQLException {
1308:                return false;
1309:            }
1310:
1311:            /**
1312:             * JDBC 2.0
1313:             *
1314:             * <p>Moves the cursor a relative number of rows, either positive or negative.
1315:             * Attempting to move beyond the first/last row in the
1316:             * result set positions the cursor before/after the
1317:             * the first/last row. Calling <code>relative(0)</code> is valid, but does
1318:             * not change the cursor position.
1319:             *
1320:             * <p>Note: Calling <code>relative(1)</code>
1321:             * is different from calling <code>next()</code>
1322:             * because is makes sense to call <code>next()</code> when there is no current row,
1323:             * for example, when the cursor is positioned before the first row
1324:             * or after the last row of the result set.
1325:             *
1326:             * @return true if the cursor is on a row; false otherwise
1327:             * @exception SQLException if a database access error occurs, there
1328:             * is no current row, or the result set type is TYPE_FORWARD_ONLY
1329:             */
1330:            public boolean relative(int rows) throws SQLException {
1331:                return false;
1332:            }
1333:
1334:            /**
1335:             * JDBC 2.0
1336:             *
1337:             * <p>Moves the cursor to the previous row in the result set.  
1338:             *
1339:             * <p>Note: <code>previous()</code> is not the same as
1340:             * <code>relative(-1)</code> because it
1341:             * makes sense to call</code>previous()</code> when there is no current row.
1342:             *
1343:             * @return true if the cursor is on a valid row; false if it is off the result set
1344:             * @exception SQLException if a database access error occurs or the
1345:             * result set type is TYPE_FORWARD_ONLY
1346:             */
1347:            public boolean previous() throws SQLException {
1348:                return false;
1349:            }
1350:
1351:            //---------------------------------------------------------------------
1352:            // Properties
1353:            //---------------------------------------------------------------------
1354:
1355:            /**
1356:             * JDBC 2.0
1357:             *
1358:             * The rows in a result set will be processed in a forward direction;
1359:             * first-to-last.
1360:             */
1361:            int FETCH_FORWARD = 1000;
1362:
1363:            /**
1364:             * JDBC 2.0
1365:             *
1366:             * The rows in a result set will be processed in a reverse direction;
1367:             * last-to-first.
1368:             */
1369:            int FETCH_REVERSE = 1001;
1370:
1371:            /**
1372:             * JDBC 2.0
1373:             * 
1374:             * The order in which rows in a result set will be processed is unknown.
1375:             */
1376:            int FETCH_UNKNOWN = 1002;
1377:
1378:            /**
1379:             * JDBC 2.0
1380:             *
1381:             * Gives a hint as to the direction in which the rows in this result set
1382:             * will be processed.  The initial value is determined by the statement
1383:             * that produced the result set.  The fetch direction may be changed
1384:             * at any time.
1385:             *
1386:             * @exception SQLException if a database access error occurs or
1387:             * the result set type is TYPE_FORWARD_ONLY and the fetch direction is not 
1388:             * FETCH_FORWARD.
1389:             */
1390:            public void setFetchDirection(int direction) throws SQLException {
1391:                return;
1392:            }
1393:
1394:            /**
1395:             * JDBC 2.0
1396:             *
1397:             * Returns the fetch direction for this result set.
1398:             *
1399:             * @return the current fetch direction for this result set
1400:             * @exception SQLException if a database access error occurs
1401:             */
1402:            public int getFetchDirection() throws SQLException {
1403:                return FETCH_FORWARD;
1404:            }
1405:
1406:            /**
1407:             * JDBC 2.0
1408:             *
1409:             * Gives the JDBC driver a hint as to the number of rows that should 
1410:             * be fetched from the database when more rows are needed for this result
1411:             * set.  If the fetch size specified is zero, the JDBC driver 
1412:             * ignores the value and is free to make its own best guess as to what
1413:             * the fetch size should be.  The default value is set by the statement 
1414:             * that created the result set.  The fetch size may be changed at any 
1415:             * time.
1416:             *
1417:             * @param rows the number of rows to fetch
1418:             * @exception SQLException if a database access error occurs or the
1419:             * condition 0 <= rows <= this.getMaxRows() is not satisfied.
1420:             */
1421:            public void setFetchSize(int rows) throws SQLException {
1422:                if (rows <= 0)
1423:                    throw new SQLException(
1424:                            "Condition 0 <= rows <= this.getMaxRows() is not satisfied");
1425:
1426:                result.setFetchSize(rows);
1427:            }
1428:
1429:            /**
1430:             * JDBC 2.0
1431:             *
1432:             * Returns the fetch size for this result set.
1433:             *
1434:             * @return the current fetch size for this result set
1435:             * @exception SQLException if a database access error occurs
1436:             */
1437:            public int getFetchSize() throws SQLException {
1438:                return result.getFetchSize();
1439:            }
1440:
1441:            /**
1442:             * JDBC 2.0
1443:             * The type for a <code>ResultSet</code> object whose cursor may
1444:             * move only forward.
1445:             */
1446:            int TYPE_FORWARD_ONLY = 1003;
1447:
1448:            /**
1449:             * JDBC 2.0
1450:             * The type for a <code>ResultSet</code> object that is scrollable
1451:             * but generally not sensitive to changes made by others.
1452:             * 
1453:             */
1454:            int TYPE_SCROLL_INSENSITIVE = 1004;
1455:
1456:            /**
1457:             * JDBC 2.0
1458:             * The type for a <code>ResultSet</code> object that is scrollable
1459:             * and generally sensitive to changes made by others.
1460:             */
1461:            int TYPE_SCROLL_SENSITIVE = 1005;
1462:
1463:            /**
1464:             * JDBC 2.0
1465:             *
1466:             * Returns the type of this result set.  The type is determined by
1467:             * the statement that created the result set.
1468:             *
1469:             * @return TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or
1470:             * TYPE_SCROLL_SENSITIVE
1471:             * @exception SQLException if a database access error occurs
1472:             */
1473:            public int getType() throws SQLException {
1474:                return result.getType();
1475:            }
1476:
1477:            /**
1478:             * JDBC 2.0
1479:             * The concurrency mode for a <code>ResultSet</code> object
1480:             * that may NOT be updated.
1481:             *  
1482:             */
1483:            int CONCUR_READ_ONLY = 1007;
1484:
1485:            /**
1486:             * JDBC 2.0
1487:             * The concurrency mode for a <code>ResultSet</code> object
1488:             * that may be updated.
1489:             * 
1490:             */
1491:            int CONCUR_UPDATABLE = 1008;
1492:
1493:            /**
1494:             * JDBC 2.0
1495:             *
1496:             * Returns the concurrency mode of this result set.  The concurrency
1497:             * used is determined by the statement that created the result set.
1498:             *
1499:             * @return the concurrency type, CONCUR_READ_ONLY or CONCUR_UPDATABLE
1500:             * @exception SQLException if a database access error occurs
1501:             */
1502:            public int getConcurrency() throws SQLException {
1503:                return CONCUR_READ_ONLY;
1504:            }
1505:
1506:            //---------------------------------------------------------------------
1507:            // Updates
1508:            //---------------------------------------------------------------------
1509:
1510:            /**
1511:             * JDBC 2.0
1512:             *
1513:             * Indicates whether the current row has been updated.  The value returned 
1514:             * depends on whether or not the result set can detect updates.
1515:             *
1516:             * @return true if the row has been visibly updated by the owner or
1517:             * another, and updates are detected
1518:             * @exception SQLException if a database access error occurs
1519:             * 
1520:             * @see DatabaseMetaData#updatesAreDetected
1521:             */
1522:            public boolean rowUpdated() throws SQLException {
1523:                return false;
1524:            }
1525:
1526:            /**
1527:             * JDBC 2.0
1528:             *
1529:             * Indicates whether the current row has had an insertion.  The value returned 
1530:             * depends on whether or not the result set can detect visible inserts.
1531:             *
1532:             * @return true if a row has had an insertion and insertions are detected
1533:             * @exception SQLException if a database access error occurs
1534:             * 
1535:             * @see DatabaseMetaData#insertsAreDetected
1536:             */
1537:            public boolean rowInserted() throws SQLException {
1538:                return false;
1539:            }
1540:
1541:            /**
1542:             * JDBC 2.0
1543:             *
1544:             * Indicates whether a row has been deleted.  A deleted row may leave
1545:             * a visible "hole" in a result set.  This method can be used to
1546:             * detect holes in a result set.  The value returned depends on whether 
1547:             * or not the result set can detect deletions.
1548:             *
1549:             * @return true if a row was deleted and deletions are detected
1550:             * @exception SQLException if a database access error occurs
1551:             * 
1552:             * @see DatabaseMetaData#deletesAreDetected
1553:             */
1554:            public boolean rowDeleted() throws SQLException {
1555:                return false;
1556:            }
1557:
1558:            /**
1559:             * JDBC 2.0
1560:             * 
1561:             * Give a nullable column a null value.
1562:             * 
1563:             * The <code>updateXXX</code> methods are used to update column values in the
1564:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1565:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1566:             * methods are called to update the database.
1567:             *
1568:             * @param columnIndex the first column is 1, the second is 2, ...
1569:             * @exception SQLException if a database access error occurs
1570:             */
1571:            public void updateNull(int columnIndex) throws SQLException {
1572:                throw new SQLException("tinySQL does not support updateNull.");
1573:            }
1574:
1575:            /**
1576:             * JDBC 2.0
1577:             * 
1578:             * Updates a column with a boolean value.
1579:             *
1580:             * The <code>updateXXX</code> methods are used to update column values in the
1581:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1582:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1583:             * methods are called to update the database.
1584:             *
1585:             * @param columnIndex the first column is 1, the second is 2, ...
1586:             * @param x the new column value
1587:             * @exception SQLException if a database access error occurs
1588:             */
1589:            public void updateBoolean(int columnIndex, boolean x)
1590:                    throws SQLException {
1591:                throw new SQLException(
1592:                        "tinySQL does not support updateBoolean.");
1593:            }
1594:
1595:            /**
1596:             * JDBC 2.0
1597:             *   
1598:             * Updates a column with a byte value.
1599:             *
1600:             * The <code>updateXXX</code> methods are used to update column values in the
1601:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1602:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1603:             * methods are called to update the database.
1604:             *
1605:             * @param columnIndex the first column is 1, the second is 2, ...
1606:             * @param x the new column value
1607:             * @exception SQLException if a database access error occurs
1608:             */
1609:            public void updateByte(int columnIndex, byte x) throws SQLException {
1610:                throw new SQLException("tinySQL does not support updateByte.");
1611:            }
1612:
1613:            /**
1614:             * JDBC 2.0
1615:             *   
1616:             * Updates a column with a short value.
1617:             *
1618:             * The <code>updateXXX</code> methods are used to update column values in the
1619:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1620:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1621:             * methods are called to update the database.
1622:             *
1623:             * @param columnIndex the first column is 1, the second is 2, ...
1624:             * @param x the new column value
1625:             * @exception SQLException if a database access error occurs
1626:             */
1627:            public void updateShort(int columnIndex, short x)
1628:                    throws SQLException {
1629:                throw new SQLException("tinySQL does not support updateShort.");
1630:            }
1631:
1632:            /**
1633:             * JDBC 2.0
1634:             *   
1635:             * Updates a column with an integer value.
1636:             *
1637:             * The <code>updateXXX</code> methods are used to update column values in the
1638:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1639:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1640:             * methods are called to update the database.
1641:             *
1642:             * @param columnIndex the first column is 1, the second is 2, ...
1643:             * @param x the new column value
1644:             * @exception SQLException if a database access error occurs
1645:             */
1646:            public void updateInt(int columnIndex, int x) throws SQLException {
1647:                throw new SQLException("tinySQL does not support updateInt.");
1648:            }
1649:
1650:            /**
1651:             * JDBC 2.0
1652:             *   
1653:             * Updates a column with a long value.
1654:             *
1655:             * The <code>updateXXX</code> methods are used to update column values in the
1656:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1657:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1658:             * methods are called to update the database.
1659:             *
1660:             * @param columnIndex the first column is 1, the second is 2, ...
1661:             * @param x the new column value
1662:             * @exception SQLException if a database access error occurs
1663:             */
1664:            public void updateLong(int columnIndex, long x) throws SQLException {
1665:                throw new SQLException("tinySQL does not support updateLong.");
1666:            }
1667:
1668:            /**
1669:             * JDBC 2.0
1670:             *  
1671:             * Updates a column with a float value.
1672:             *
1673:             * The <code>updateXXX</code> methods are used to update column values in the
1674:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1675:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1676:             * methods are called to update the database.
1677:             *
1678:             * @param columnIndex the first column is 1, the second is 2, ...
1679:             * @param x the new column value
1680:             * @exception SQLException if a database access error occurs
1681:             */
1682:            public void updateFloat(int columnIndex, float x)
1683:                    throws SQLException {
1684:                throw new SQLException("tinySQL does not support updateFloat.");
1685:            }
1686:
1687:            /**
1688:             * JDBC 2.0
1689:             *  
1690:             * Updates a column with a Double value.
1691:             *
1692:             * The <code>updateXXX</code> methods are used to update column values in the
1693:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1694:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1695:             * methods are called to update the database.
1696:             *
1697:             * @param columnIndex the first column is 1, the second is 2, ...
1698:             * @param x the new column value
1699:             * @exception SQLException if a database access error occurs
1700:             */
1701:            public void updateDouble(int columnIndex, double x)
1702:                    throws SQLException {
1703:                throw new SQLException("tinySQL does not support updateDouble.");
1704:            }
1705:
1706:            /**
1707:             * JDBC 2.0
1708:             *  
1709:             * Updates a column with a BigDecimal value.
1710:             *
1711:             * The <code>updateXXX</code> methods are used to update column values in the
1712:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1713:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1714:             * methods are called to update the database.
1715:             *
1716:             * @param columnIndex the first column is 1, the second is 2, ...
1717:             * @param x the new column value
1718:             * @exception SQLException if a database access error occurs
1719:             */
1720:            public void updateBigDecimal(int columnIndex, BigDecimal x)
1721:                    throws SQLException {
1722:                throw new SQLException(
1723:                        "tinySQL does not support updateBigDecimal.");
1724:            }
1725:
1726:            /**
1727:             * JDBC 2.0
1728:             *  
1729:             * Updates a column with a String value.
1730:             *
1731:             * The <code>updateXXX</code> methods are used to update column values in the
1732:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1733:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1734:             * methods are called to update the database.
1735:             *
1736:             * @param columnIndex the first column is 1, the second is 2, ...
1737:             * @param x the new column value
1738:             * @exception SQLException if a database access error occurs
1739:             */
1740:            public void updateString(int columnIndex, String x)
1741:                    throws SQLException {
1742:                throw new SQLException("tinySQL does not support updateString.");
1743:            }
1744:
1745:            /**
1746:             * JDBC 2.0
1747:             *  
1748:             * Updates a column with a byte array value.
1749:             *
1750:             * The <code>updateXXX</code> methods are used to update column values in the
1751:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1752:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1753:             * methods are called to update the database.
1754:             *
1755:             * @param columnIndex the first column is 1, the second is 2, ...
1756:             * @param x the new column value
1757:             * @exception SQLException if a database access error occurs
1758:             */
1759:            public void updateBytes(int columnIndex, byte x[])
1760:                    throws SQLException {
1761:                throw new SQLException("tinySQL does not support updateBytes.");
1762:            }
1763:
1764:            /**
1765:             * JDBC 2.0
1766:             *  
1767:             * Updates a column with a Date value.
1768:             *
1769:             * The <code>updateXXX</code> methods are used to update column values in the
1770:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1771:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1772:             * methods are called to update the database.
1773:             *
1774:             * @param columnIndex the first column is 1, the second is 2, ...
1775:             * @param x the new column value
1776:             * @exception SQLException if a database access error occurs
1777:             */
1778:            public void updateDate(int columnIndex, java.sql.Date x)
1779:                    throws SQLException {
1780:                throw new SQLException("tinySQL does not support updateDate.");
1781:            }
1782:
1783:            /**
1784:             * JDBC 2.0
1785:             *  
1786:             * Updates a column with a Time value.
1787:             *
1788:             * The <code>updateXXX</code> methods are used to update column values in the
1789:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1790:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1791:             * methods are called to update the database.
1792:             *
1793:             * @param columnIndex the first column is 1, the second is 2, ...
1794:             * @param x the new column value
1795:             * @exception SQLException if a database access error occurs
1796:             */
1797:            public void updateTime(int columnIndex, java.sql.Time x)
1798:                    throws SQLException {
1799:                throw new SQLException("tinySQL does not support updateTime.");
1800:            }
1801:
1802:            /**
1803:             * JDBC 2.0
1804:             *  
1805:             * Updates a column with a Timestamp value.
1806:             *
1807:             * The <code>updateXXX</code> methods are used to update column values in the
1808:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1809:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1810:             * methods are called to update the database.
1811:             *
1812:             * @param columnIndex the first column is 1, the second is 2, ...
1813:             * @param x the new column value
1814:             * @exception SQLException if a database access error occurs
1815:             */
1816:            public void updateTimestamp(int columnIndex, java.sql.Timestamp x)
1817:                    throws SQLException {
1818:                throw new SQLException(
1819:                        "tinySQL does not support updateTimestamp.");
1820:            }
1821:
1822:            /** 
1823:             * JDBC 2.0
1824:             *  
1825:             * Updates a column with an ascii stream value.
1826:             *
1827:             * The <code>updateXXX</code> methods are used to update column values in the
1828:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1829:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1830:             * methods are called to update the database.
1831:             *
1832:             * @param columnIndex the first column is 1, the second is 2, ...
1833:             * @param x the new column value
1834:             * @param length the length of the stream
1835:             * @exception SQLException if a database access error occurs
1836:             */
1837:            public void updateAsciiStream(int columnIndex,
1838:                    java.io.InputStream x, int length) throws SQLException {
1839:                throw new SQLException(
1840:                        "tinySQL does not support updateAsciiStream.");
1841:            }
1842:
1843:            /** 
1844:             * JDBC 2.0
1845:             *  
1846:             * Updates a column with a binary stream value.
1847:             *
1848:             * The <code>updateXXX</code> methods are used to update column values in the
1849:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1850:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1851:             * methods are called to update the database.
1852:             *
1853:             * @param columnIndex the first column is 1, the second is 2, ...
1854:             * @param x the new column value     
1855:             * @param length the length of the stream
1856:             * @exception SQLException if a database access error occurs
1857:             */
1858:            public void updateBinaryStream(int columnIndex,
1859:                    java.io.InputStream x, int length) throws SQLException {
1860:                throw new SQLException(
1861:                        "tinySQL does not support updateBinaryStream.");
1862:            }
1863:
1864:            /**
1865:             * JDBC 2.0
1866:             *  
1867:             * Updates a column with a character stream value.
1868:             *
1869:             * The <code>updateXXX</code> methods are used to update column values in the
1870:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1871:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1872:             * methods are called to update the database.
1873:             *
1874:             * @param columnIndex the first column is 1, the second is 2, ...
1875:             * @param x the new column value
1876:             * @param length the length of the stream
1877:             * @exception SQLException if a database access error occurs
1878:             */
1879:            public void updateCharacterStream(int columnIndex,
1880:                    java.io.Reader x, int length) throws SQLException {
1881:                throw new SQLException(
1882:                        "tinySQL does not support updateCharacterStream.");
1883:            }
1884:
1885:            /**
1886:             * JDBC 2.0
1887:             *  
1888:             * Updates a column with an Object value.
1889:             *
1890:             * The <code>updateXXX</code> methods are used to update column values in the
1891:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1892:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1893:             * methods are called to update the database.
1894:             *
1895:             * @param columnIndex the first column is 1, the second is 2, ...
1896:             * @param x the new column value
1897:             * @param scale For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
1898:             *  this is the number of digits after the decimal.  For all other
1899:             *  types this value will be ignored.
1900:             * @exception SQLException if a database access error occurs
1901:             */
1902:            public void updateObject(int columnIndex, Object x, int scale)
1903:                    throws SQLException {
1904:                throw new SQLException("tinySQL does not support updateObject.");
1905:            }
1906:
1907:            /**
1908:             * JDBC 2.0
1909:             *  
1910:             * Updates a column with an Object value.
1911:             *
1912:             * The <code>updateXXX</code> methods are used to update column values in the
1913:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1914:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1915:             * methods are called to update the database.
1916:             *
1917:             * @param columnIndex the first column is 1, the second is 2, ...
1918:             * @param x the new column value
1919:             * @exception SQLException if a database access error occurs
1920:             */
1921:            public void updateObject(int columnIndex, Object x)
1922:                    throws SQLException {
1923:                throw new SQLException("tinySQL does not support updateObject.");
1924:            }
1925:
1926:            /**
1927:             * JDBC 2.0
1928:             *  
1929:             * Updates a column with a null value.
1930:             *
1931:             * The <code>updateXXX</code> methods are used to update column values in the
1932:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1933:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1934:             * methods are called to update the database.
1935:             *
1936:             * @param columnName the name of the column
1937:             * @exception SQLException if a database access error occurs
1938:             */
1939:            public void updateNull(String columnName) throws SQLException {
1940:                throw new SQLException("tinySQL does not support updateNull.");
1941:            }
1942:
1943:            /**
1944:             * JDBC 2.0
1945:             *  
1946:             * Updates a column with a boolean value.
1947:             *
1948:             * The <code>updateXXX</code> methods are used to update column values in the
1949:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1950:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1951:             * methods are called to update the database.
1952:             *
1953:             * @param columnName the name of the column
1954:             * @param x the new column value
1955:             * @exception SQLException if a database access error occurs
1956:             */
1957:            public void updateBoolean(String columnName, boolean x)
1958:                    throws SQLException {
1959:                throw new SQLException(
1960:                        "tinySQL does not support updateBoolean.");
1961:            }
1962:
1963:            /**
1964:             * JDBC 2.0
1965:             *  
1966:             * Updates a column with a byte value.
1967:             *
1968:             * The <code>updateXXX</code> methods are used to update column values in the
1969:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1970:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1971:             * methods are called to update the database.
1972:             *
1973:             * @param columnName the name of the column
1974:             * @param x the new column value
1975:             * @exception SQLException if a database access error occurs
1976:             */
1977:            public void updateByte(String columnName, byte x)
1978:                    throws SQLException {
1979:                throw new SQLException("tinySQL does not support updateByte.");
1980:            }
1981:
1982:            /**
1983:             * JDBC 2.0
1984:             *  
1985:             * Updates a column with a short value.
1986:             *
1987:             * The <code>updateXXX</code> methods are used to update column values in the
1988:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
1989:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
1990:             * methods are called to update the database.
1991:             *
1992:             * @param columnName the name of the column
1993:             * @param x the new column value
1994:             * @exception SQLException if a database access error occurs
1995:             */
1996:            public void updateShort(String columnName, short x)
1997:                    throws SQLException {
1998:                throw new SQLException("tinySQL does not support updateShort.");
1999:            }
2000:
2001:            /**
2002:             * JDBC 2.0
2003:             *  
2004:             * Updates a column with an integer value.
2005:             *
2006:             * The <code>updateXXX</code> methods are used to update column values in the
2007:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2008:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2009:             * methods are called to update the database.
2010:             *
2011:             * @param columnName the name of the column
2012:             * @param x the new column value
2013:             * @exception SQLException if a database access error occurs
2014:             */
2015:            public void updateInt(String columnName, int x) throws SQLException {
2016:                throw new SQLException("tinySQL does not support updateInt.");
2017:            }
2018:
2019:            /**
2020:             * JDBC 2.0
2021:             *  
2022:             * Updates a column with a long value.
2023:             *
2024:             * The <code>updateXXX</code> methods are used to update column values in the
2025:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2026:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2027:             * methods are called to update the database.
2028:             *
2029:             * @param columnName the name of the column
2030:             * @param x the new column value
2031:             * @exception SQLException if a database access error occurs
2032:             */
2033:            public void updateLong(String columnName, long x)
2034:                    throws SQLException {
2035:                throw new SQLException("tinySQL does not support updateLong.");
2036:            }
2037:
2038:            /**
2039:             * JDBC 2.0
2040:             *  
2041:             * Updates a column with a float value.
2042:             *
2043:             * The <code>updateXXX</code> methods are used to update column values in the
2044:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2045:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2046:             * methods are called to update the database.
2047:             *
2048:             * @param columnName the name of the column
2049:             * @param x the new column value
2050:             * @exception SQLException if a database access error occurs
2051:             */
2052:            public void updateFloat(String columnName, float x)
2053:                    throws SQLException {
2054:                throw new SQLException("tinySQL does not support updateFloat.");
2055:            }
2056:
2057:            /**
2058:             * JDBC 2.0
2059:             *  
2060:             * Updates a column with a double value.
2061:             *
2062:             * The <code>updateXXX</code> methods are used to update column values in the
2063:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2064:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2065:             * methods are called to update the database.
2066:             *
2067:             * @param columnName the name of the column
2068:             * @param x the new column value
2069:             * @exception SQLException if a database access error occurs
2070:             */
2071:            public void updateDouble(String columnName, double x)
2072:                    throws SQLException {
2073:                throw new SQLException("tinySQL does not support updateDouble.");
2074:            }
2075:
2076:            /**
2077:             * JDBC 2.0
2078:             *  
2079:             * Updates a column with a BigDecimal value.
2080:             *
2081:             * The <code>updateXXX</code> methods are used to update column values in the
2082:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2083:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2084:             * methods are called to update the database.
2085:             *
2086:             * @param columnName the name of the column
2087:             * @param x the new column value
2088:             * @exception SQLException if a database access error occurs
2089:             */
2090:            public void updateBigDecimal(String columnName, BigDecimal x)
2091:                    throws SQLException {
2092:                throw new SQLException(
2093:                        "tinySQL does not support updateDecimal.");
2094:            }
2095:
2096:            /**
2097:             * JDBC 2.0
2098:             *  
2099:             * Updates a column with a String value.
2100:             *
2101:             * The <code>updateXXX</code> methods are used to update column values in the
2102:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2103:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2104:             * methods are called to update the database.
2105:             *
2106:             * @param columnName the name of the column
2107:             * @param x the new column value
2108:             * @exception SQLException if a database access error occurs
2109:             */
2110:            public void updateString(String columnName, String x)
2111:                    throws SQLException {
2112:                throw new SQLException("tinySQL does not support updateString.");
2113:            }
2114:
2115:            /**
2116:             * JDBC 2.0
2117:             *  
2118:             * Updates a column with a byte array value.
2119:             *
2120:             * The <code>updateXXX</code> methods are used to update column values in the
2121:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2122:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2123:             * methods are called to update the database.
2124:             *
2125:             * @param columnName the name of the column
2126:             * @param x the new column value
2127:             * @exception SQLException if a database access error occurs
2128:             */
2129:            public void updateBytes(String columnName, byte x[])
2130:                    throws SQLException {
2131:                throw new SQLException("tinySQL does not support updateBytes.");
2132:            }
2133:
2134:            /**
2135:             * JDBC 2.0
2136:             *  
2137:             * Updates a column with a Date value.
2138:             *
2139:             * The <code>updateXXX</code> methods are used to update column values in the
2140:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2141:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2142:             * methods are called to update the database.
2143:             *
2144:             * @param columnName the name of the column
2145:             * @param x the new column value
2146:             * @exception SQLException if a database access error occurs
2147:             */
2148:            public void updateDate(String columnName, java.sql.Date x)
2149:                    throws SQLException {
2150:                throw new SQLException("tinySQL does not support updateDate.");
2151:            }
2152:
2153:            /**
2154:             * JDBC 2.0
2155:             *  
2156:             * Updates a column with a Time value.
2157:             *
2158:             * The <code>updateXXX</code> methods are used to update column values in the
2159:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2160:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2161:             * methods are called to update the database.
2162:             *
2163:             * @param columnName the name of the column
2164:             * @param x the new column value
2165:             * @exception SQLException if a database access error occurs
2166:             */
2167:            public void updateTime(String columnName, java.sql.Time x)
2168:                    throws SQLException {
2169:                throw new SQLException("tinySQL does not support updateTime.");
2170:            }
2171:
2172:            /**
2173:             * JDBC 2.0
2174:             *  
2175:             * Updates a column with a Timestamp value.
2176:             *
2177:             * The <code>updateXXX</code> methods are used to update column values in the
2178:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2179:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2180:             * methods are called to update the database.
2181:             *
2182:             * @param columnName the name of the column
2183:             * @param x the new column value
2184:             * @exception SQLException if a database access error occurs
2185:             */
2186:            public void updateTimestamp(String columnName, java.sql.Timestamp x)
2187:                    throws SQLException {
2188:                throw new SQLException(
2189:                        "tinySQL does not support updateTimestamp.");
2190:            }
2191:
2192:            /** 
2193:             * JDBC 2.0
2194:             *  
2195:             * Updates a column with an ascii stream value.
2196:             *
2197:             * The <code>updateXXX</code> methods are used to update column values in the
2198:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2199:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2200:             * methods are called to update the database.
2201:             *
2202:             * @param columnName the name of the column
2203:             * @param x the new column value
2204:             * @param length of the stream
2205:             * @exception SQLException if a database access error occurs
2206:             */
2207:            public void updateAsciiStream(String columnName,
2208:                    java.io.InputStream x, int length) throws SQLException {
2209:                throw new SQLException(
2210:                        "tinySQL does not support updateAsciiStream.");
2211:            }
2212:
2213:            /** 
2214:             * JDBC 2.0
2215:             *  
2216:             * Updates a column with a binary stream value.
2217:             *
2218:             * The <code>updateXXX</code> methods are used to update column values in the
2219:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2220:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2221:             * methods are called to update the database.
2222:             *
2223:             * @param columnName the name of the column
2224:             * @param x the new column value
2225:             * @param length of the stream
2226:             * @exception SQLException if a database access error occurs
2227:             */
2228:            public void updateBinaryStream(String columnName,
2229:                    java.io.InputStream x, int length) throws SQLException {
2230:                throw new SQLException(
2231:                        "tinySQL does not support updateBinaryStream.");
2232:            }
2233:
2234:            /**
2235:             * JDBC 2.0
2236:             *  
2237:             * Updates a column with a character stream value.
2238:             *
2239:             * The <code>updateXXX</code> methods are used to update column values in the
2240:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2241:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2242:             * methods are called to update the database.
2243:             *
2244:             * @param columnName the name of the column
2245:             * @param x the new column value
2246:             * @param length of the stream
2247:             * @exception SQLException if a database access error occurs
2248:             */
2249:            public void updateCharacterStream(String columnName,
2250:                    java.io.Reader reader, int length) throws SQLException {
2251:                throw new SQLException(
2252:                        "tinySQL does not support updateCharacter.");
2253:            }
2254:
2255:            /**
2256:             * JDBC 2.0
2257:             *  
2258:             * Updates a column with an Object value.
2259:             *
2260:             * The <code>updateXXX</code> methods are used to update column values in the
2261:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2262:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2263:             * methods are called to update the database.
2264:             *
2265:             * @param columnName the name of the column
2266:             * @param x the new column value
2267:             * @param scale For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
2268:             *  this is the number of digits after the decimal.  For all other
2269:             *  types this value will be ignored.
2270:             * @exception SQLException if a database access error occurs
2271:             */
2272:            public void updateObject(String columnName, Object x, int scale)
2273:                    throws SQLException {
2274:                throw new SQLException("tinySQL does not support updateObject.");
2275:            }
2276:
2277:            /**
2278:             * JDBC 2.0
2279:             *  
2280:             * Updates a column with an Object value.
2281:             *
2282:             * The <code>updateXXX</code> methods are used to update column values in the
2283:             * current row, or the insert row.  The <code>updateXXX</code> methods do not 
2284:             * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
2285:             * methods are called to update the database.
2286:             *
2287:             * @param columnName the name of the column
2288:             * @param x the new column value
2289:             * @exception SQLException if a database access error occurs
2290:             */
2291:            public void updateObject(String columnName, Object x)
2292:                    throws SQLException {
2293:                throw new SQLException("tinySQL does not support updateObject.");
2294:            }
2295:
2296:            /**
2297:             * JDBC 2.0
2298:             *
2299:             * Inserts the contents of the insert row into the result set and
2300:             * the database.  Must be on the insert row when this method is called.
2301:             *
2302:             * @exception SQLException if a database access error occurs,
2303:             * if called when not on the insert row, or if not all of non-nullable columns in
2304:             * the insert row have been given a value
2305:             */
2306:            public void insertRow() throws SQLException {
2307:                throw new SQLException("tinySQL does not support insertRow.");
2308:            }
2309:
2310:            /**
2311:             * JDBC 2.0
2312:             *
2313:             * Updates the underlying database with the new contents of the
2314:             * current row.  Cannot be called when on the insert row.
2315:             *
2316:             * @exception SQLException if a database access error occurs or
2317:             * if called when on the insert row
2318:             */
2319:            public void updateRow() throws SQLException {
2320:                throw new SQLException("tinySQL does not support updateRow.");
2321:            }
2322:
2323:            /**
2324:             * JDBC 2.0
2325:             *
2326:             * Deletes the current row from the result set and the underlying
2327:             * database.  Cannot be called when on the insert row.
2328:             *
2329:             * @exception SQLException if a database access error occurs or if
2330:             * called when on the insert row.
2331:             */
2332:            public void deleteRow() throws SQLException {
2333:                throw new SQLException("tinySQL does not support deleteRow.");
2334:            }
2335:
2336:            /**
2337:             * JDBC 2.0
2338:             *
2339:             * Refreshes the current row with its most recent value in 
2340:             * the database.  Cannot be called when on the insert row.
2341:             *
2342:             * The <code>refreshRow</code> method provides a way for an application to 
2343:             * explicitly tell the JDBC driver to refetch a row(s) from the
2344:             * database.  An application may want to call <code>refreshRow</code> when 
2345:             * caching or prefetching is being done by the JDBC driver to
2346:             * fetch the latest value of a row from the database.  The JDBC driver 
2347:             * may actually refresh multiple rows at once if the fetch size is 
2348:             * greater than one.
2349:             * 
2350:             * All values are refetched subject to the transaction isolation 
2351:             * level and cursor sensitivity.  If <code>refreshRow</code> is called after
2352:             * calling <code>updateXXX</code>, but before calling <code>updateRow</code>, then the
2353:             * updates made to the row are lost.  Calling the method <code>refreshRow</code> frequently
2354:             * will likely slow performance.
2355:             *
2356:             * @exception SQLException if a database access error occurs or if
2357:             * called when on the insert row
2358:             */
2359:            public void refreshRow() throws SQLException {
2360:                throw new SQLException("tinySQL does not support RefreshRow.");
2361:            }
2362:
2363:            /**
2364:             * JDBC 2.0
2365:             *
2366:             * Cancels the updates made to a row.
2367:             * This method may be called after calling an
2368:             * <code>updateXXX</code> method(s) and before calling <code>updateRow</code> to rollback 
2369:             * the updates made to a row.  If no updates have been made or 
2370:             * <code>updateRow</code> has already been called, then this method has no 
2371:             * effect.
2372:             *
2373:             * @exception SQLException if a database access error occurs or if
2374:             * called when on the insert row
2375:             *
2376:             */
2377:            public void cancelRowUpdates() throws SQLException {
2378:                throw new SQLException(
2379:                        "tinySQL does not support cancelRowUpdate.");
2380:            }
2381:
2382:            /**
2383:             * JDBC 2.0
2384:             *
2385:             * Moves the cursor to the insert row.  The current cursor position is 
2386:             * remembered while the cursor is positioned on the insert row.
2387:             *
2388:             * The insert row is a special row associated with an updatable
2389:             * result set.  It is essentially a buffer where a new row may
2390:             * be constructed by calling the <code>updateXXX</code> methods prior to 
2391:             * inserting the row into the result set.  
2392:             *
2393:             * Only the <code>updateXXX</code>, <code>getXXX</code>,
2394:             * and <code>insertRow</code> methods may be 
2395:             * called when the cursor is on the insert row.  All of the columns in 
2396:             * a result set must be given a value each time this method is
2397:             * called before calling <code>insertRow</code>.  
2398:             * The method <code>updateXXX</code> must be called before a
2399:             * <code>getXXX</code> method can be called on a column value.
2400:             *
2401:             * @exception SQLException if a database access error occurs
2402:             * or the result set is not updatable
2403:             */
2404:            public void moveToInsertRow() throws SQLException {
2405:                throw new SQLException(
2406:                        "tinySQL does not support moveToInsertRow.");
2407:            }
2408:
2409:            /**
2410:             * JDBC 2.0
2411:             *
2412:             * Moves the cursor to the remembered cursor position, usually the
2413:             * current row.  This method has no effect if the cursor is not on the insert 
2414:             * row. 
2415:             *
2416:             * @exception SQLException if a database access error occurs
2417:             * or the result set is not updatable
2418:             */
2419:            public void moveToCurrentRow() throws SQLException {
2420:                throw new SQLException(
2421:                        "tinySQL does not support moveToCurrentRow.");
2422:            }
2423:
2424:            /**
2425:             * JDBC 2.0
2426:             *
2427:             * Returns the Statement that produced this <code>ResultSet</code> object.
2428:             * If the result set was generated some other way, such as by a
2429:             * <code>DatabaseMetaData</code> method, this method returns <code>null</code>.
2430:             *
2431:             * @return the Statment that produced the result set or
2432:             * null if the result set was produced some other way
2433:             * @exception SQLException if a database access error occurs
2434:             */
2435:            public Statement getStatement() throws SQLException {
2436:                return statement;
2437:            }
2438:
2439:            /**
2440:             * JDBC 2.0
2441:             *
2442:             * Returns the value of a column in the current row as a Java object.  
2443:             * This method uses the given <code>Map</code> object
2444:             * for the custom mapping of the
2445:             * SQL structured or distinct type that is being retrieved.
2446:             *
2447:             * @param i the first column is 1, the second is 2, ...
2448:             * @param map the mapping from SQL type names to Java classes
2449:             * @return an object representing the SQL value
2450:             */
2451:            public Object getObject(int i, java.util.Map map)
2452:                    throws SQLException {
2453:                throw new SQLException("tinySQL does not support getObject.");
2454:            }
2455:
2456:            /**
2457:             * JDBC 2.0
2458:             *
2459:             * Gets a REF(&lt;structured-type&gt;) column value from the current row.
2460:             *
2461:             * @param i the first column is 1, the second is 2, ...
2462:             * @return a <code>Ref</code> object representing an SQL REF value
2463:             */
2464:            public Ref getRef(int i) throws SQLException {
2465:                throw new SQLException("tinySQL does not support getRef.");
2466:            }
2467:
2468:            /**
2469:             * JDBC 2.0
2470:             *
2471:             * Gets a BLOB value in the current row of this <code>ResultSet</code> object.
2472:             *
2473:             * @param i the first column is 1, the second is 2, ...
2474:             * @return a <code>Blob</code> object representing the SQL BLOB value in
2475:             *         the specified column
2476:             */
2477:            public Blob getBlob(int i) throws SQLException {
2478:                throw new SQLException("tinySQL does not support getBlob.");
2479:            }
2480:
2481:            /**
2482:             * JDBC 2.0
2483:             *
2484:             * Gets a CLOB value in the current row of this <code>ResultSet</code> object.
2485:             *
2486:             * @param i the first column is 1, the second is 2, ...
2487:             * @return a <code>Clob</code> object representing the SQL CLOB value in
2488:             *         the specified column
2489:             */
2490:            public Clob getClob(int i) throws SQLException {
2491:                throw new SQLException("tinySQL does not support getClob.");
2492:            }
2493:
2494:            /**
2495:             * JDBC 2.0
2496:             *
2497:             * Gets an SQL ARRAY value from the current row of this <code>ResultSet</code> object.
2498:             *
2499:             * @param i the first column is 1, the second is 2, ...
2500:             * @return an <code>Array</code> object representing the SQL ARRAY value in
2501:             *         the specified column
2502:             */
2503:            public Array getArray(int i) throws SQLException {
2504:                throw new SQLException("tinySQL does not support getArray.");
2505:            }
2506:
2507:            /**
2508:             * JDBC 2.0
2509:             *
2510:             * Returns the value in the specified column as a Java object.  
2511:             * This method uses the specified <code>Map</code> object for
2512:             * custom mapping if appropriate.
2513:             *
2514:             * @param colName the name of the column from which to retrieve the value
2515:             * @param map the mapping from SQL type names to Java classes
2516:             * @return an object representing the SQL value in the specified column
2517:             */
2518:            public Object getObject(String colName, java.util.Map map)
2519:                    throws SQLException {
2520:                throw new SQLException("tinySQL does not support getObject.");
2521:            }
2522:
2523:            /**
2524:             * JDBC 2.0
2525:             *
2526:             * Gets a REF(&lt;structured-type&gt;) column value from the current row.
2527:             *
2528:             * @param colName the column name
2529:             * @return a <code>Ref</code> object representing the SQL REF value in
2530:             *         the specified column
2531:             */
2532:            public Ref getRef(String colName) throws SQLException {
2533:                throw new SQLException("tinySQL does not support getRef.");
2534:            }
2535:
2536:            /**
2537:             * JDBC 2.0
2538:             *
2539:             * Gets a BLOB value in the current row of this <code>ResultSet</code> object.
2540:             *
2541:             * @param colName the name of the column from which to retrieve the value
2542:             * @return a <code>Blob</code> object representing the SQL BLOB value in
2543:             *         the specified column
2544:             */
2545:            public Blob getBlob(String colName) throws SQLException {
2546:                throw new SQLException("tinySQL does not support getBlob.");
2547:            }
2548:
2549:            /**
2550:             * JDBC 2.0
2551:             *
2552:             * Gets a CLOB value in the current row of this <code>ResultSet</code> object.
2553:             *
2554:             * @param colName the name of the column from which to retrieve the value
2555:             * @return a <code>Clob</code> object representing the SQL CLOB value in
2556:             *         the specified column
2557:             */
2558:            public Clob getClob(String colName) throws SQLException {
2559:                throw new SQLException("tinySQL does not support getClob.");
2560:            }
2561:
2562:            /**
2563:             * JDBC 2.0
2564:             *
2565:             * Gets an SQL ARRAY value in the current row of this <code>ResultSet</code> object.
2566:             *
2567:             * @param colName the name of the column from which to retrieve the value
2568:             * @return an <code>Array</code> object representing the SQL ARRAY value in
2569:             *         the specified column
2570:             */
2571:            public Array getArray(String colName) throws SQLException {
2572:                throw new SQLException("tinySQL does not support getArray.");
2573:            }
2574:
2575:            /**
2576:             * JDBC 2.0
2577:             *
2578:             * Gets the value of a column in the current row as a java.sql.Date 
2579:             * object. This method uses the given calendar to construct an appropriate millisecond
2580:             * value for the Date if the underlying database does not store
2581:             * timezone information.
2582:             *
2583:             * @param columnIndex the first column is 1, the second is 2, ...
2584:             * @param cal the calendar to use in constructing the date
2585:             * @return the column value; if the value is SQL NULL, the result is null
2586:             * @exception SQLException if a database access error occurs
2587:             */
2588:            public java.sql.Date getDate(int columnIndex, Calendar cal)
2589:                    throws SQLException {
2590:                throw new SQLException("tinySQL does not support getDate.");
2591:            }
2592:
2593:            /**
2594:             * Gets the value of a column in the current row as a java.sql.Date 
2595:             * object. This method uses the given calendar to construct an appropriate millisecond
2596:             * value for the Date, if the underlying database does not store
2597:             * timezone information.
2598:             *
2599:             * @param columnName the SQL name of the column from which to retrieve the value
2600:             * @param cal the calendar to use in constructing the date
2601:             * @return the column value; if the value is SQL NULL, the result is null
2602:             * @exception SQLException if a database access error occurs
2603:             */
2604:            public java.sql.Date getDate(String columnName, Calendar cal)
2605:                    throws SQLException {
2606:                throw new SQLException("tinySQL does not support getDate.");
2607:            }
2608:
2609:            /**
2610:             * Gets the value of a column in the current row as a java.sql.Time 
2611:             * object. This method uses the given calendar to construct an appropriate millisecond
2612:             * value for the Time if the underlying database does not store
2613:             * timezone information.
2614:             *
2615:             * @param columnIndex the first column is 1, the second is 2, ...
2616:             * @param cal the calendar to use in constructing the time
2617:             * @return the column value; if the value is SQL NULL, the result is null
2618:             * @exception SQLException if a database access error occurs
2619:             */
2620:            public java.sql.Time getTime(int columnIndex, Calendar cal)
2621:                    throws SQLException {
2622:                throw new SQLException("tinySQL does not support getTime.");
2623:            }
2624:
2625:            /**
2626:             * Gets the value of a column in the current row as a java.sql.Time 
2627:             * object. This method uses the given calendar to construct an appropriate millisecond
2628:             * value for the Time if the underlying database does not store
2629:             * timezone information.
2630:             *
2631:             * @param columnName the SQL name of the column
2632:             * @param cal the calendar to use in constructing the time
2633:             * @return the column value; if the value is SQL NULL, the result is null
2634:             * @exception SQLException if a database access error occurs
2635:             */
2636:            public java.sql.Time getTime(String columnName, Calendar cal)
2637:                    throws SQLException {
2638:                throw new SQLException("tinySQL does not support getTime.");
2639:            }
2640:
2641:            /**
2642:             * Gets the value of a column in the current row as a java.sql.Timestamp 
2643:             * object. This method uses the given calendar to construct an appropriate millisecond
2644:             * value for the Timestamp if the underlying database does not store
2645:             * timezone information.
2646:             *
2647:             * @param columnIndex the first column is 1, the second is 2, ...
2648:             * @param cal the calendar to use in constructing the timestamp
2649:             * @return the column value; if the value is SQL NULL, the result is null
2650:             * @exception SQLException if a database access error occurs
2651:             */
2652:            public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal)
2653:                    throws SQLException {
2654:                throw new SQLException("tinySQL does not support getTimestamp.");
2655:            }
2656:
2657:            /**
2658:             * Gets the value of a column in the current row as a java.sql.Timestamp 
2659:             * object. This method uses the given calendar to construct an appropriate millisecond
2660:             * value for the Timestamp if the underlying database does not store
2661:             * timezone information.
2662:             *
2663:             * @param columnName the SQL name of the column
2664:             * @param cal the calendar to use in constructing the timestamp
2665:             * @return the column value; if the value is SQL NULL, the result is null
2666:             * @exception SQLException if a database access error occurs
2667:             */
2668:            public java.sql.Timestamp getTimestamp(String columnName,
2669:                    Calendar cal) throws SQLException {
2670:                throw new SQLException("tinySQL does not support getTimestamp.");
2671:            }
2672:
2673:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.