1. /*
  2. * @(#)RowSetInternal.java 1.8 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.sql;
  8. import java.sql.*;
  9. /**
  10. * The interface that a <code>RowSet</code> object implements in order to
  11. * present itself to a <code>RowSetReader</code> or <code>RowSetWriter</code>
  12. * object. The <code>RowSetInternal</code> interface contains
  13. * methods that let the reader or writer access and modify the internal
  14. * state of the rowset.
  15. *
  16. * @since 1.4
  17. */
  18. public interface RowSetInternal {
  19. /**
  20. * Retrieves the parameters that have been set for this
  21. * <code>RowSet</code> object's command.
  22. *
  23. * @return an array of the current parameter values for this <code>RowSet</code>
  24. * object's command
  25. * @exception SQLException if a database access error occurs
  26. */
  27. Object[] getParams() throws SQLException;
  28. /**
  29. * Retrieves the <code>Connection</code> object that was passed to this
  30. * <code>RowSet</code> object.
  31. *
  32. * @return the <code>Connection</code> object passed to the rowset
  33. * or <code>null</code> if none was passed
  34. * @exception SQLException if a database access error occurs
  35. */
  36. Connection getConnection() throws SQLException;
  37. /**
  38. * Sets the given <code>RowSetMetaData</code> object as the
  39. * <code>RowSetMetaData</code> object for this <code>RowSet</code>
  40. * object. The <code>RowSetReader</code> object associated with the rowset
  41. * will use <code>RowSetMetaData</code> methods to set the values giving
  42. * information about the rowset's columns.
  43. *
  44. * @param md the <code>RowSetMetaData</code> object that will be set with
  45. * information about the rowset's columns
  46. *
  47. * @exception SQLException if a database access error occurs
  48. */
  49. void setMetaData(RowSetMetaData md) throws SQLException;
  50. /**
  51. * Retrieves a <code>ResultSet</code> object containing the original
  52. * value of this <code>RowSet</code> object.
  53. * <P>
  54. * The cursor is positioned before the first row in the result set.
  55. * Only rows contained in the result set returned by the method
  56. * <code>getOriginal</code> are said to have an original value.
  57. *
  58. * @return the original value of the rowset
  59. * @exception SQLException if a database access error occurs
  60. */
  61. public ResultSet getOriginal() throws SQLException;
  62. /**
  63. * Retrieves a <code>ResultSet</code> object containing the original value
  64. * of the current row only. If the current row has no original value,
  65. * an empty result set is returned. If there is no current row,
  66. * an exception is thrown.
  67. *
  68. * @return the original value of the current row as a <code>ResultSet</code>
  69. * object
  70. * @exception SQLException if a database access error occurs or this method
  71. * is called while the cursor is on the insert row, before the
  72. * first row, or after the last row
  73. */
  74. public ResultSet getOriginalRow() throws SQLException;
  75. }