1. /*
  2. * @(#)RowSetMetaData.java 1.7 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. * An object that contains information about the columns in a
  11. * <code>RowSet</code> object. This interface is
  12. * an extension of the <code>ResultSetMetaData</code> interface with
  13. * methods for setting the values in a <code>RowSetMetaData</code> object.
  14. * When a <code>RowSetReader</code> object reads data into a <code>RowSet</code>
  15. * object, it creates a <code>RowSetMetaData</code> object and initializes it
  16. * using the methods in the <code>RowSetMetaData</code> interface. Then the
  17. * reader passes the <code>RowSetMetaData</code> object to the rowset.
  18. * <P>
  19. * The methods in this interface are invoked internally when an application
  20. * calls the method <code>RowSet.execute</code> an application
  21. * programmer would not use them directly.
  22. *
  23. * @since 1.4
  24. */
  25. public interface RowSetMetaData extends ResultSetMetaData {
  26. /**
  27. * Sets the number of columns in the <code>RowSet</code> object to
  28. * the given number.
  29. *
  30. * @param columnCount the number of columns in the <code>RowSet</code> object
  31. * @exception SQLException if a database access error occurs
  32. */
  33. void setColumnCount(int columnCount) throws SQLException;
  34. /**
  35. * Sets whether the designated column is automatically numbered,
  36. * and thus read-only. The default is for a <code>RowSet</code> object's
  37. * columns not to be automatically numbered.
  38. *
  39. * @param columnIndex the first column is 1, the second is 2, ...
  40. * @param property <code>true</code> if the column is automatically
  41. * numbered; <code>false</code> if it is not
  42. *
  43. * @exception SQLException if a database access error occurs
  44. */
  45. void setAutoIncrement(int columnIndex, boolean property) throws SQLException;
  46. /**
  47. * Sets whether the designated column is case sensitive.
  48. * The default is <code>false</code>.
  49. *
  50. * @param columnIndex the first column is 1, the second is 2, ...
  51. * @param property <code>true</code> if the column is case sensitive;
  52. * <code>false</code> if it is not
  53. *
  54. * @exception SQLException if a database access error occurs
  55. */
  56. void setCaseSensitive(int columnIndex, boolean property) throws SQLException;
  57. /**
  58. * Sets whether the designated column can be used in a where clause.
  59. * The default is <code>false</code>.
  60. *
  61. * @param columnIndex the first column is 1, the second is 2, ...
  62. * @param property <code>true</code> if the column can be used in a
  63. * <code>WHERE</code> clause; <code>false</code> if it cannot
  64. *
  65. * @exception SQLException if a database access error occurs
  66. */
  67. void setSearchable(int columnIndex, boolean property) throws SQLException;
  68. /**
  69. * Sets whether the designated column is a cash value.
  70. * The default is <code>false</code>.
  71. *
  72. * @param columnIndex the first column is 1, the second is 2, ...
  73. * @param property <code>true</code> if the column is a cash value;
  74. * <code>false</code> if it is not
  75. *
  76. * @exception SQLException if a database access error occurs
  77. */
  78. void setCurrency(int columnIndex, boolean property) throws SQLException;
  79. /**
  80. * Sets whether the designated column's value can be set to
  81. * <code>NULL</code>.
  82. * The default is <code>ResultSetMetaData.columnNullableUnknown</code>
  83. *
  84. * @param columnIndex the first column is 1, the second is 2, ...
  85. * @param property one of the following constants:
  86. * <code>ResultSetMetaData.columnNoNulls</code>,
  87. * <code>ResultSetMetaData.columnNullable</code>, or
  88. * <code>ResultSetMetaData.columnNullableUnknown</code>
  89. *
  90. * @exception SQLException if a database access error occurs
  91. */
  92. void setNullable(int columnIndex, int property) throws SQLException;
  93. /**
  94. * Sets whether the designated column is a signed number.
  95. * The default is <code>false</code>.
  96. *
  97. * @param columnIndex the first column is 1, the second is 2, ...
  98. * @param property <code>true</code> if the column is a signed number;
  99. * <code>false</code> if it is not
  100. *
  101. * @exception SQLException if a database access error occurs
  102. */
  103. void setSigned(int columnIndex, boolean property) throws SQLException;
  104. /**
  105. * Sets the designated column's normal maximum width in chars to the
  106. * given <code>int</code>.
  107. *
  108. * @param columnIndex the first column is 1, the second is 2, ...
  109. * @param size the normal maximum number of characters for
  110. * the designated column
  111. *
  112. * @exception SQLException if a database access error occurs
  113. */
  114. void setColumnDisplaySize(int columnIndex, int size) throws SQLException;
  115. /**
  116. * Sets the suggested column title for use in printouts and
  117. * displays, if any, to the given <code>String</code>.
  118. *
  119. * @param columnIndex the first column is 1, the second is 2, ...
  120. * @param label the column title
  121. * @exception SQLException if a database access error occurs
  122. */
  123. void setColumnLabel(int columnIndex, String label) throws SQLException;
  124. /**
  125. * Sets the name of the designated column to the given <code>String</code>.
  126. *
  127. * @param columnIndex the first column is 1, the second is 2, ...
  128. * @param columnName the designated column's name
  129. * @exception SQLException if a database access error occurs
  130. */
  131. void setColumnName(int columnIndex, String columnName) throws SQLException;
  132. /**
  133. * Sets the name of the designated column's table's schema, if any, to
  134. * the given <code>String</code>.
  135. *
  136. * @param columnIndex the first column is 1, the second is 2, ...
  137. * @param schemaName the schema name
  138. * @exception SQLException if a database access error occurs
  139. */
  140. void setSchemaName(int columnIndex, String schemaName) throws SQLException;
  141. /**
  142. * Sets the designated column's number of decimal digits to the
  143. * given <code>int</code>.
  144. *
  145. * @param columnIndex the first column is 1, the second is 2, ...
  146. * @param precision the total number of decimal digits
  147. * @exception SQLException if a database access error occurs
  148. */
  149. void setPrecision(int columnIndex, int precision) throws SQLException;
  150. /**
  151. * Sets the designated column's number of digits to the
  152. * right of the decimal point to the given <code>int</code>.
  153. *
  154. * @param columnIndex the first column is 1, the second is 2, ...
  155. * @param scale the number of digits to right of decimal point
  156. * @exception SQLException if a database access error occurs
  157. */
  158. void setScale(int columnIndex, int scale) throws SQLException;
  159. /**
  160. * Sets the designated column's table name, if any, to the given
  161. * <code>String</code>.
  162. *
  163. * @param columnIndex the first column is 1, the second is 2, ...
  164. * @param tableName the column's table name
  165. * @exception SQLException if a database access error occurs
  166. */
  167. void setTableName(int columnIndex, String tableName) throws SQLException;
  168. /**
  169. * Sets the designated column's table's catalog name, if any, to the given
  170. * <code>String</code>.
  171. *
  172. * @param columnIndex the first column is 1, the second is 2, ...
  173. * @param catalogName the column's catalog name
  174. * @exception SQLException if a database access error occurs
  175. */
  176. void setCatalogName(int columnIndex, String catalogName) throws SQLException;
  177. /**
  178. * Sets the designated column's SQL type to the one given.
  179. *
  180. * @param columnIndex the first column is 1, the second is 2, ...
  181. * @param SQLType the column's SQL type
  182. * @exception SQLException if a database access error occurs
  183. * @see Types
  184. */
  185. void setColumnType(int columnIndex, int SQLType) throws SQLException;
  186. /**
  187. * Sets the designated column's type name that is specific to the
  188. * data source, if any, to the given <code>String</code>.
  189. *
  190. * @param columnIndex the first column is 1, the second is 2, ...
  191. * @param typeName data source specific type name.
  192. * @exception SQLException if a database access error occurs
  193. */
  194. void setColumnTypeName(int columnIndex, String typeName) throws SQLException;
  195. }