View Javadoc
1 /* 2 * CsvJdbc - a JDBC driver for CSV files 3 * Copyright (C) 2001 Jonathan Ackerman 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 19 package org.relique.jdbc.csv; 20 21 import java.sql.CallableStatement; 22 import java.sql.Connection; 23 import java.sql.DatabaseMetaData; 24 import java.sql.PreparedStatement; 25 import java.sql.SQLException; 26 import java.sql.SQLWarning; 27 import java.sql.Savepoint; 28 import java.sql.Statement; 29 import java.util.Enumeration; 30 import java.util.Hashtable; 31 import java.util.Map; 32 import java.util.Properties; 33 import java.util.Vector; 34 35 /*** 36 * This class implements the Connection interface for the CsvJdbc driver. 37 * 38 * @author Jonathan Ackerman 39 * @author Sander Brienen 40 * @author Michael Maraya 41 * @author Tomasz Skutnik 42 * @version $Id: CsvConnection.html,v 1.1 2003/05/12 16:19:47 sinisa Exp $ 43 */ 44 public class CsvConnection implements Connection { 45 46 /*** Directory where the CSV files to use are located */ 47 private String path; 48 49 /*** File extension to use */ 50 private String extension = CsvDriver.DEFAULT_EXTENSION; 51 52 /*** Field separator to use */ 53 private char separator = CsvDriver.DEFAULT_SEPARATOR; 54 55 /*** Should headers be suppressed */ 56 private boolean suppressHeaders = CsvDriver.DEFAULT_SUPPRESS; 57 58 /*** Collection of all created Statements */ 59 private Vector statements = new Vector(); 60 61 /*** Charset that should be used to read the files */ 62 private String charset = null; 63 64 /*** Stores whether this Connection is closed or not */ 65 private boolean closed; 66 67 /*** 68 * Creates a new CsvConnection that takes the supplied path 69 * @param path directory where the CSV files are located 70 */ 71 protected CsvConnection(String path) { 72 // validate argument(s) 73 if(path == null || path.length() == 0) { 74 throw new IllegalArgumentException( 75 "'path' argument may not be empty or null"); 76 } 77 this.path = path; 78 } 79 80 /*** 81 * Creates a new CsvConnection that takes the supplied path and properties 82 * @param path directory where the CSV files are located 83 * @param info set of properties containing custom options 84 */ 85 protected CsvConnection(String path, Properties info) { 86 this(path); 87 // check for properties 88 if(info != null) { 89 // set the file extension to be used 90 if(info.getProperty(CsvDriver.FILE_EXTENSION) != null) { 91 extension = info.getProperty(CsvDriver.FILE_EXTENSION); 92 } 93 // set the separator character to be used 94 if(info.getProperty(CsvDriver.SEPARATOR) != null) { 95 separator = info.getProperty(CsvDriver.SEPARATOR).charAt(0); 96 } 97 // set the header suppression flag 98 if(info.getProperty(CsvDriver.SUPPRESS_HEADERS) != null) { 99 suppressHeaders = Boolean.valueOf(info.getProperty( 100 CsvDriver.SUPPRESS_HEADERS)).booleanValue(); 101 } 102 // default charset 103 if (info.getProperty(CsvDriver.CHARSET) != null) { 104 charset = info.getProperty(CsvDriver.CHARSET); 105 } 106 } 107 } 108 109 /*** 110 * Creates a <code>Statement</code> object for sending 111 * SQL statements to the database. 112 * SQL statements without parameters are normally 113 * executed using <code>Statement</code> objects. If the same SQL statement 114 * is executed many times, it may be more efficient to use a 115 * <code>PreparedStatement</code> object. 116 * <P> 117 * Result sets created using the returned <code>Statement</code> 118 * object will by default be type <code>TYPE_FORWARD_ONLY</code> 119 * and have a concurrency level of <code>CONCUR_READ_ONLY</code>. 120 * 121 * @return a new default <code>Statement</code> object 122 * @exception SQLException if a database access error occurs 123 */ 124 public Statement createStatement() throws SQLException { 125 CsvStatement statement = new CsvStatement(this); 126 statements.add(statement); 127 return statement; 128 } 129 130 /*** 131 * Creates a <code>PreparedStatement</code> object for sending 132 * parameterized SQL statements to the database. 133 * <P> 134 * A SQL statement with or without IN parameters can be 135 * pre-compiled and stored in a <code>PreparedStatement</code> object. This 136 * object can then be used to efficiently execute this statement 137 * multiple times. 138 * 139 * <P><B>Note:</B> This method is optimized for handling 140 * parametric SQL statements that benefit from precompilation. If 141 * the driver supports precompilation, 142 * the method <code>prepareStatement</code> will send 143 * the statement to the database for precompilation. Some drivers 144 * may not support precompilation. In this case, the statement may 145 * not be sent to the database until the <code>PreparedStatement</code> 146 * object is executed. This has no direct effect on users; however, it does 147 * affect which methods throw certain <code>SQLException</code> objects. 148 * <P> 149 * Result sets created using the returned <code>PreparedStatement</code> 150 * object will by default be type <code>TYPE_FORWARD_ONLY</code> 151 * and have a concurrency level of <code>CONCUR_READ_ONLY</code>. 152 * 153 * @param sql an SQL statement that may contain one or more '?' IN 154 * parameter placeholders 155 * @return a new default <code>PreparedStatement</code> object containing the 156 * pre-compiled SQL statement 157 * @exception SQLException if a database access error occurs 158 */ 159 public PreparedStatement prepareStatement(String sql) throws SQLException { 160 throw new UnsupportedOperationException( 161 "Connection.prepareStatement(String) unsupported"); 162 } 163 164 /*** 165 * Creates a <code>CallableStatement</code> object for calling 166 * database stored procedures. 167 * The <code>CallableStatement</code> object provides 168 * methods for setting up its IN and OUT parameters, and 169 * methods for executing the call to a stored procedure. 170 * 171 * <P><B>Note:</B> This method is optimized for handling stored 172 * procedure call statements. Some drivers may send the call 173 * statement to the database when the method <code>prepareCall</code> 174 * is done; others 175 * may wait until the <code>CallableStatement</code> object 176 * is executed. This has no 177 * direct effect on users; however, it does affect which method 178 * throws certain SQLExceptions. 179 * <P> 180 * Result sets created using the returned <code>CallableStatement</code> 181 * object will by default be type <code>TYPE_FORWARD_ONLY</code> 182 * and have a concurrency level of <code>CONCUR_READ_ONLY</code>. 183 * 184 * @param sql an SQL statement that may contain one or more '?' 185 * parameter placeholders. Typically this statement is a JDBC 186 * function call escape string. 187 * @return a new default <code>CallableStatement</code> object containing the 188 * pre-compiled SQL statement 189 * @exception SQLException if a database access error occurs 190 */ 191 public CallableStatement prepareCall(String sql) throws SQLException { 192 throw new UnsupportedOperationException( 193 "Connection.prepareCall(String) unsupported"); 194 } 195 196 /*** 197 * Converts the given SQL statement into the system's native SQL grammar. 198 * A driver may convert the JDBC SQL grammar into its system's 199 * native SQL grammar prior to sending it. This method returns the 200 * native form of the statement that the driver would have sent. 201 * 202 * @param sql an SQL statement that may contain one or more '?' 203 * parameter placeholders 204 * @return the native form of this statement 205 * @exception SQLException if a database access error occurs 206 */ 207 public String nativeSQL(String sql) throws SQLException { 208 throw new UnsupportedOperationException( 209 "Connection.nativeSQL(String) unsupported"); 210 } 211 212 /*** 213 * Sets this connection's auto-commit mode to the given state. 214 * If a connection is in auto-commit mode, then all its SQL 215 * statements will be executed and committed as individual 216 * transactions. Otherwise, its SQL statements are grouped into 217 * transactions that are terminated by a call to either 218 * the method <code>commit</code> or the method <code>rollback</code>. 219 * By default, new connections are in auto-commit 220 * mode. 221 * <P> 222 * The commit occurs when the statement completes or the next 223 * execute occurs, whichever comes first. In the case of 224 * statements returning a <code>ResultSet</code> object, 225 * the statement completes when the last row of the 226 * <code>ResultSet</code> object has been retrieved or the 227 * <code>ResultSet</code> object has been closed. In advanced cases, a 228 * single statement may return multiple results as well as output 229 * parameter values. In these cases, the commit occurs when all results and 230 * output parameter values have been retrieved. 231 * <P> 232 * <B>NOTE:</B> If this method is called during a transaction, the 233 * transaction is committed. 234 * 235 * @param autoCommit <code>true</code> to enable auto-commit mode; 236 * <code>false</code> to disable it 237 * @exception SQLException if a database access error occurs 238 * @see #getAutoCommit 239 */ 240 public void setAutoCommit(boolean autoCommit) throws SQLException { 241 // throw new UnsupportedOperationException( 242 // "Connection.setAutoCommit(boolean) unsupported"); 243 } 244 245 /*** 246 * Retrieves the current auto-commit mode for this <code>Connection</code> 247 * object. 248 * 249 * @return the current state of this <code>Connection</code> object's 250 * auto-commit mode 251 * @exception SQLException if a database access error occurs 252 * @see #setAutoCommit 253 */ 254 public boolean getAutoCommit() throws SQLException { 255 // throw new UnsupportedOperationException( 256 // "Connection.getAutoCommit() unsupported"); 257 return true; 258 } 259 260 /*** 261 * Makes all changes made since the previous 262 * commit/rollback permanent and releases any database locks 263 * currently held by this <code>Connection</code> object. 264 * This method should be 265 * used only when auto-commit mode has been disabled. 266 * 267 * @exception SQLException if a database access error occurs or this 268 * <code>Connection</code> object is in auto-commit mode 269 * @see #setAutoCommit 270 */ 271 public void commit() throws SQLException { 272 // throw new UnsupportedOperationException( 273 // "Connection.commit() unsupported"); 274 } 275 276 /*** 277 * Undoes all changes made in the current transaction 278 * and releases any database locks currently held 279 * by this <code>Connection</code> object. This method should be 280 * used only when auto-commit mode has been disabled. 281 * 282 * @exception SQLException if a database access error occurs or this 283 * <code>Connection</code> object is in auto-commit mode 284 * @see #setAutoCommit 285 */ 286 public void rollback() throws SQLException { 287 throw new UnsupportedOperationException( 288 "Connection.rollback() unsupported"); 289 } 290 291 /*** 292 * Releases this <code>Connection</code> object's database and JDBC 293 * resources immediately instead of waiting for them to be automatically 294 * released. 295 * <P> 296 * Calling the method <code>close</code> on a <code>Connection</code> 297 * object that is already closed is a no-op. 298 * <P> 299 * <B>Note:</B> A <code>Connection</code> object is automatically 300 * closed when it is garbage collected. Certain fatal errors also 301 * close a <code>Connection</code> object. 302 * 303 * @exception SQLException if a database access error occurs 304 */ 305 public void close() throws SQLException { 306 // close all created statements 307 for(Enumeration i = statements.elements(); i.hasMoreElements(); ) { 308 CsvStatement statement = (CsvStatement)i.nextElement(); 309 statement.close(); 310 } 311 // set this Connection as closed 312 closed = true; 313 } 314 315 /*** 316 * Retrieves whether this <code>Connection</code> object has been 317 * closed. A connection is closed if the method <code>close</code> 318 * has been called on it or if certain fatal errors have occurred. 319 * This method is guaranteed to return <code>true</code> only when 320 * it is called after the method <code>Connection.close</code> has 321 * been called. 322 * <P> 323 * This method generally cannot be called to determine whether a 324 * connection to a database is valid or invalid. A typical client 325 * can determine that a connection is invalid by catching any 326 * exceptions that might be thrown when an operation is attempted. 327 * 328 * @return <code>true</code> if this <code>Connection</code> object 329 * is closed; <code>false</code> if it is still open 330 * @exception SQLException if a database access error occurs 331 */ 332 public boolean isClosed() throws SQLException { 333 return closed; 334 } 335 336 /*** 337 * Retrieves a <code>DatabaseMetaData</code> object that contains 338 * metadata about the database to which this 339 * <code>Connection</code> object represents a connection. 340 * The metadata includes information about the database's 341 * tables, its supported SQL grammar, its stored 342 * procedures, the capabilities of this connection, and so on. 343 * 344 * @return a <code>DatabaseMetaData</code> object for this 345 * <code>Connection</code> object 346 * @exception SQLException if a database access error occurs 347 */ 348 public DatabaseMetaData getMetaData() throws SQLException { 349 throw new UnsupportedOperationException( 350 "Connection.getMetaData() unsupported"); 351 } 352 353 /*** 354 * Puts this connection in read-only mode as a hint to the driver to enable 355 * database optimizations. 356 * 357 * <P><B>Note:</B> This method cannot be called during a transaction. 358 * 359 * @param readOnly <code>true</code> enables read-only mode; 360 * <code>false</code> disables it 361 * @exception SQLException if a database access error occurs or this 362 * method is called during a transaction 363 */ 364 public void setReadOnly(boolean readOnly) throws SQLException { 365 throw new UnsupportedOperationException( 366 "Connection.setReadOnly(boolean) unsupported"); 367 } 368 369 /*** 370 * Retrieves whether this <code>Connection</code> 371 * object is in read-only mode. 372 * 373 * @return <code>true</code> if this <code>Connection</code> object 374 * is read-only; <code>false</code> otherwise 375 * @exception SQLException if a database access error occurs 376 */ 377 public boolean isReadOnly() throws SQLException { 378 return true; 379 } 380 381 /*** 382 * Sets the given catalog name in order to select 383 * a subspace of this <code>Connection</code> object's database 384 * in which to work. 385 * <P> 386 * If the driver does not support catalogs, it will 387 * silently ignore this request. 388 * 389 * @param catalog the name of a catalog (subspace in this 390 * <code>Connection</code> object's database) in which to work 391 * @exception SQLException if a database access error occurs 392 * @see #getCatalog 393 */ 394 public void setCatalog(String catalog) throws SQLException { 395 // silently ignore this request 396 } 397 398 /*** 399 * Retrieves this <code>Connection</code> object's current catalog name. 400 * 401 * @return the current catalog name or <code>null</code> if there is none 402 * @exception SQLException if a database access error occurs 403 * @see #setCatalog 404 */ 405 public String getCatalog() throws SQLException { 406 return null; 407 } 408 409 /*** 410 * Attempts to change the transaction isolation level for this 411 * <code>Connection</code> object to the one given. 412 * The constants defined in the interface <code>Connection</code> 413 * are the possible transaction isolation levels. 414 * <P> 415 * <B>Note:</B> If this method is called during a transaction, the result 416 * is implementation-defined. 417 * 418 * @param level one of the following <code>Connection</code> constants: 419 * <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>, 420 * <code>Connection.TRANSACTION_READ_COMMITTED</code>, 421 * <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or 422 * <code>Connection.TRANSACTION_SERIALIZABLE</code>. 423 * (Note that <code>Connection.TRANSACTION_NONE</code> cannot be used 424 * because it specifies that transactions are not supported.) 425 * @exception SQLException if a database access error occurs 426 * or the given parameter is not one of the <code>Connection</code> 427 * constants 428 * @see DatabaseMetaData#supportsTransactionIsolationLevel 429 * @see #getTransactionIsolation 430 */ 431 public void setTransactionIsolation(int level) throws SQLException { 432 throw new UnsupportedOperationException( 433 "Connection.setTransactionIsolation(int) unsupported"); 434 } 435 436 /*** 437 * Retrieves this <code>Connection</code> object's current 438 * transaction isolation level. 439 * 440 * @return the current transaction isolation level, which will be one 441 * of the following constants: 442 * <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>, 443 * <code>Connection.TRANSACTION_READ_COMMITTED</code>, 444 * <code>Connection.TRANSACTION_REPEATABLE_READ</code>, 445 * <code>Connection.TRANSACTION_SERIALIZABLE</code>, or 446 * <code>Connection.TRANSACTION_NONE</code>. 447 * @exception SQLException if a database access error occurs 448 * @see #setTransactionIsolation 449 */ 450 public int getTransactionIsolation() throws SQLException { 451 return Connection.TRANSACTION_NONE; 452 } 453 454 /*** 455 * Retrieves the first warning reported by calls on this 456 * <code>Connection</code> object. If there is more than one 457 * warning, subsequent warnings will be chained to the first one 458 * and can be retrieved by calling the method 459 * <code>SQLWarning.getNextWarning</code> on the warning 460 * that was retrieved previously. 461 * <P> 462 * This method may not be 463 * called on a closed connection; doing so will cause an 464 * <code>SQLException</code> to be thrown. 465 * 466 * <P><B>Note:</B> Subsequent warnings will be chained to this 467 * SQLWarning. 468 * 469 * @return the first <code>SQLWarning</code> object or <code>null</code> 470 * if there are none 471 * @exception SQLException if a database access error occurs or 472 * this method is called on a closed connection 473 * @see SQLWarning 474 */ 475 public SQLWarning getWarnings() throws SQLException { 476 throw new UnsupportedOperationException( 477 "Connection.getWarnings() unsupported"); 478 } 479 480 /*** 481 * Clears all warnings reported for this <code>Connection</code> object. 482 * After a call to this method, the method <code>getWarnings</code> 483 * returns <code>null</code> until a new warning is 484 * reported for this <code>Connection</code> object. 485 * 486 * @exception SQLException if a database access error occurs 487 */ 488 public void clearWarnings() throws SQLException { 489 throw new UnsupportedOperationException( 490 "Connection.getWarnings() unsupported"); 491 } 492 493 //--------------------------JDBC 2.0----------------------------- 494 495 /*** 496 * Creates a <code>Statement</code> object that will generate 497 * <code>ResultSet</code> objects with the given type and concurrency. 498 * This method is the same as the <code>createStatement</code> method 499 * above, but it allows the default result set 500 * type and concurrency to be overridden. 501 * 502 * @param resultSetType a result set type; one of 503 * <code>ResultSet.TYPE_FORWARD_ONLY</code>, 504 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or 505 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 506 * @param resultSetConcurrency a concurrency type; one of 507 * <code>ResultSet.CONCUR_READ_ONLY</code> or 508 * <code>ResultSet.CONCUR_UPDATABLE</code> 509 * @return a new <code>Statement</code> object that will generate 510 * <code>ResultSet</code> objects with the given type and 511 * concurrency 512 * @exception SQLException if a database access error occurs 513 * or the given parameters are not <code>ResultSet</code> 514 * constants indicating type and concurrency 515 */ 516 public Statement createStatement(int resultSetType, int resultSetConcurrency) 517 throws SQLException { 518 throw new UnsupportedOperationException( 519 "Connection.createStatement(int, int) unsupported"); 520 } 521 522 /*** 523 * Creates a <code>PreparedStatement</code> object that will generate 524 * <code>ResultSet</code> objects with the given type and concurrency. 525 * This method is the same as the <code>prepareStatement</code> method 526 * above, but it allows the default result set 527 * type and concurrency to be overridden. 528 * 529 * @param sql a <code>String</code> object that is the SQL statement to 530 * be sent to the database; may contain one or more ? IN 531 * parameters 532 * @param resultSetType a result set type; one of 533 * <code>ResultSet.TYPE_FORWARD_ONLY</code>, 534 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or 535 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 536 * @param resultSetConcurrency a concurrency type; one of 537 * <code>ResultSet.CONCUR_READ_ONLY</code> or 538 * <code>ResultSet.CONCUR_UPDATABLE</code> 539 * @return a new PreparedStatement object containing the 540 * pre-compiled SQL statement that will produce <code>ResultSet</code> 541 * objects with the given type and concurrency 542 * @exception SQLException if a database access error occurs 543 * or the given parameters are not <code>ResultSet</code> 544 * constants indicating type and concurrency 545 */ 546 public PreparedStatement prepareStatement(String sql, int resultSetType, 547 int resultSetConcurrency) throws SQLException { 548 throw new UnsupportedOperationException( 549 "Connection.prepareStatement(String, int, int) unsupported"); 550 } 551 552 /*** 553 * Creates a <code>CallableStatement</code> object that will generate 554 * <code>ResultSet</code> objects with the given type and concurrency. 555 * This method is the same as the <code>prepareCall</code> method 556 * above, but it allows the default result set 557 * type and concurrency to be overridden. 558 * 559 * @param sql a <code>String</code> object that is the SQL statement to 560 * be sent to the database; may contain on or more ? parameters 561 * @param resultSetType a result set type; one of 562 * <code>ResultSet.TYPE_FORWARD_ONLY</code>, 563 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or 564 * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 565 * @param resultSetConcurrency a concurrency type; one of 566 * <code>ResultSet.CONCUR_READ_ONLY</code> or 567 * <code>ResultSet.CONCUR_UPDATABLE</code> 568 * @return a new <code>CallableStatement</code> object containing the 569 * pre-compiled SQL statement that will produce <code>ResultSet</code> 570 * objects with the given type and concurrency 571 * @exception SQLException if a database access error occurs 572 * or the given parameters are not <code>ResultSet</code> 573 * constants indicating type and concurrency 574 */ 575 public CallableStatement prepareCall(String sql, int resultSetType, 576 int resultSetConcurrency) throws SQLException { 577 throw new UnsupportedOperationException( 578 "Connection.prepareCall(String, int, int) unsupported"); 579 } 580 581 /*** 582 * Retrieves the <code>Map</code> object associated with this 583 * <code>Connection</code> object. 584 * Unless the application has added an entry, the type map returned 585 * will be empty. 586 * 587 * @return the <code>java.util.Map</code> object associated 588 * with this <code>Connection</code> object 589 * @exception SQLException if a database access error occurs 590 * @see #setTypeMap 591 */ 592 public Map getTypeMap() throws SQLException { 593 throw new UnsupportedOperationException( 594 "Connection.getTypeMap() unsupported"); 595 } 596 597 /*** 598 * Installs the given <code>TypeMap</code> object as the type map for 599 * this <code>Connection</code> object. The type map will be used for the 600 * custom mapping of SQL structured types and distinct types. 601 * 602 * @param map the <code>java.util.Map</code> object to install 603 * as the replacement for this <code>Connection</code> 604 * object's default type map 605 * @exception SQLException if a database access error occurs or 606 * the given parameter is not a <code>java.util.Map</code> 607 * object 608 * @see #getTypeMap 609 */ 610 public void setTypeMap(Map map) throws SQLException { 611 throw new UnsupportedOperationException( 612 "Connection.setTypeMap(Map) unsupported"); 613 } 614 615 //--------------------------JDBC 3.0----------------------------- 616 /*** 617 * Changes the holdability of <code>ResultSet</code> objects 618 * created using this <code>Connection</code> object to the given 619 * holdability. 620 * 621 * @param holdability a <code>ResultSet</code> holdability constant; one of 622 * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or 623 * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code> 624 * @throws SQLException if a database access occurs, the given parameter 625 * is not a <code>ResultSet</code> constant indicating holdability, 626 * or the given holdability is not supported 627 * @since 1.4 628 * @see #getHoldability 629 * @see java.sql.ResultSet 630 */ 631 public void setHoldability(int holdability) throws SQLException { 632 throw new UnsupportedOperationException("Connection.setHoldability(int) unsupported"); 633 } 634 635 /*** 636 * Retrieves the current holdability of ResultSet objects created 637 * using this Connection object. 638 * 639 * @return the holdability, one of <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or 640 * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code> 641 * @throws SQLException if a database access occurs 642 * @since 1.4 643 * @see #setHoldability 644 * @see java.sql.ResultSet 645 */ 646 public int getHoldability() throws SQLException { 647 throw new UnsupportedOperationException("Connection.getHoldability() unsupported"); 648 } 649 650 // Removed since this only builds under JDK 1.4 651 public Savepoint setSavepoint() throws SQLException { 652 throw new UnsupportedOperationException("Connection.setSavepoint() unsupported"); 653 } 654 655 public Savepoint setSavepoint(String name) throws SQLException { 656 throw new UnsupportedOperationException("Connection.setSavepoint(String) unsupported"); 657 } 658 659 public void rollback(Savepoint savepoint) throws SQLException { 660 throw new UnsupportedOperationException("Connection.rollback(Savepoint) unsupported"); 661 } 662 663 public void releaseSavepoint(Savepoint savepoint) throws SQLException { 664 throw new UnsupportedOperationException("Connection.releaseSavepoint(Savepoint) unsupported"); 665 } 666 667 668 public Statement createStatement(int resultSetType, 669 int resultSetConcurrency, 670 int resultSetHoldability) throws SQLException { 671 throw new UnsupportedOperationException("Connection.createStatement(int,int,int) unsupported"); 672 } 673 674 public PreparedStatement prepareStatement(String sql, 675 int resultSetType, 676 int resultSetConcurrency, 677 int resultSetHoldability) throws SQLException { 678 throw new UnsupportedOperationException("Connection.prepareStatement(String,int,int,int) unsupported"); 679 } 680 681 public CallableStatement prepareCall(String sql, 682 int resultSetType, 683 int resultSetConcurrency, 684 int resultSetHoldability) throws SQLException { 685 throw new UnsupportedOperationException("Connection.prepareCall(String,int,int,int) unsupported"); 686 } 687 688 public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { 689 throw new UnsupportedOperationException("Connection.prepareStatement(String,int) unsupported"); 690 } 691 692 public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { 693 throw new UnsupportedOperationException("Connection.prepareStatement(String,int[]) unsupported"); 694 } 695 696 public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { 697 throw new UnsupportedOperationException("Connection.prepareStatement(String,String[]) unsupported"); 698 } 699 700 //--------------------------------------------------------------------- 701 // Properties 702 //--------------------------------------------------------------------- 703 704 /*** 705 * Accessor method for the path property 706 * @return current value for the path property 707 */ 708 protected String getPath() { 709 return path; 710 } 711 712 /*** 713 * Accessor method for the extension property 714 * @return current value for the extension property 715 */ 716 protected String getExtension() { 717 return extension; 718 } 719 720 /*** 721 * Accessor method for the separator property 722 * @return current value for the separator property 723 */ 724 protected char getSeperator() { 725 return separator; 726 } 727 728 /*** 729 * Accessor method for the suppressHeaders property 730 * @return current value for the suppressHeaders property 731 */ 732 protected boolean isSuppressHeaders() { 733 return suppressHeaders; 734 } 735 736 /*** 737 * Accessor method for the charset property 738 * @return current value for the suppressHeaders property 739 */ 740 protected String getCharset() { 741 return charset; 742 } 743 744 }

This page automatically generated by Maven