Java

Topic: JDBC

Explain Setting Properties?

All rowsets maintain a set of properties, which will usually be set using a tool. The number and kinds of properties a rowset has will vary, depending on what the rowset does and how it gets its data. For example, rowsets that get their data from a ResultSet object need to set the properties that are required for making a database connection. If a rowset uses the DriverManager facility to make a connection, it needs to set a property for the JDBC URL that identifies the appropriate driver, and it needs to set the properties that give the user name and password. If, on the other hand, the rowset uses a DataSource object to make the connection, which is the preferred method, it does not need to set the property for the JDBC URL. Instead, it needs to set properties for the logical name of the data source, for the user name, and for the password.NOTE: In order to use a DataSource object for making a connection, the DataSource object must have been registered with a naming service that uses the Java Naming and Directory InterfaceTM (JNDI) API. This registration is usually done by a person acting in the capacity of a system administrator.In order to be able to populate itself with data from a database, a rowset needs to set a command property. This property is a query that is a PreparedStatement object, which allows the query to have parameter placeholders that are set at run time, as opposed to design time. To set these placeholder parameters with values, a rowset provides setter methods for setting values of each data type, similar to the setter methods provided by the PreparedStatement interface.The following code fragment illustrates how the CachedRowSet object crs might have its command property set. Note that if a tool is used to set properties, this is the code that the tool would use.    crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS " +                   "WHERE CREDIT_LIMIT > ? AND REGION = ?"); 

Browse random answers:

What does the connection object represents?
Explain method Creating a CachedRowSet Object?
Explain Retrieving Data from a CachedRowSet Object?
Explain method Retrieving RowSetMetaData?
Explain method Updating a CachedRowSet Object?
Explain method Updating the Underlying Data Source?
Explain method Registering and Notifying Listeners?
Explain method Passing Data to Thin Clients?
Explain Scrolling and Updating?
Explain Getting Universal Data Access?
Explain Setting Properties?
Explain Paging Data?
Explain Background?
Explain  Predicate Sharing?
Explain Updating a FilteredRowSet Object?
Explain Behavior of Rows Outside the Filter?
Explain Creating a JdbcRowSet Object?
Explain boolean getShowDeleted() throws SQLException?
Explain void setShowDeleted(boolean b) throws SQLException?
Explain about getRowSetWarningsRowSetWarning getRowSetWarnings()                                throws SQLException?
Explain about  void commit() throws SQLException?
Explain getAutoCommitboolean getAutoCommit()                      throws SQLException?
Explain void setAutoCommit(boolean autoCommit)                   throws SQLException?
Explain about void rollback()              throws SQLException?
Explain void rollback(Savepoint s)              throws SQLException?
Explain about  Managing Multiple Match Columns?
Explain about void setMatchColumn(int columnIdx)                    throws SQLException?
Explain setMatchColumnvoid setMatchColumn(int[] columnIdxes)                    throws SQLException
Explain about setMatchColumnvoid setMatchColumn(String columnName)                    throws SQLException?
Explain about setMatchColumnvoid setMatchColumn(String[] columnNames)                    throws SQLException?
Explain about getMatchColumnIndexesint[] getMatchColumnIndexes()                            throws SQLException
Explain about getMatchColumnNamesString[] getMatchColumnNames()                             throws SQLException?
Explain about unsetMatchColumnvoid unsetMatchColumn(int columnIdx)                      throws SQLException
Explain about unsetMatchColumnvoid unsetMatchColumn(int[] columnIdxes)                      throws SQLException?
Explain unsetMatchColumnvoid unsetMatchColumn(String columnName)                      throws SQLException?
UnsetMatchColumnvoid unsetMatchColumn(String[] columnName)                      throws SQLException
Using a JoinRowSet Object for Creating a JOIN
JoinRowSet Methods
Explain method CROSS_JOIN?
Explain about INNER_JOINstatic final int INNER_JOIN?
Explain the difference between LEFT_OUTER_JOINstatic final int LEFT_OUTER_JOIN?
Explain method RIGHT_OUTER_JOIN?
Explain the difference between FULL_JOINstatic final int FULL_JOIN
Explain about addRowSetvoid addRowSet(Joinable rowset)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet rowset,             int columnIdx)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet rowset,             String columnName)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet[] rowset,             int[] columnIdx)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet[] rowset,             String[] columnName)               throws SQLException?
Explain about getRowSetsCollection<?> getRowSets()                         throws SQLException?
Explain getRowSetNamesString[] getRowSetNames()                        throws SQLException?
Explain toCachedRowSetCachedRowSet toCachedRowSet()                            throws SQLException?
Explain aboutpublic abstract class BaseRowSetextends Objectimplements Serializable, Cloneable?
Explain the difference between UNICODE_STREAM_PARAMpublic static final int UNICODE_STREAM_PARAM?
Explain the difference between BINARY_STREAM_PARAMpublic static final int BINARY_STREAM_PARAM?
Explain the difference between ASCII_STREAM_PARAMpublic static final int ASCII_STREAM_PARAM?
Explain the difference between binaryStreamprotected InputStream binaryStream?
Explain the difference between unicodeStreamprotected InputStream unicodeStream?
Explain the difference between asciiStreamprotected InputStream asciiStream?
Explain the difference between charStreamprotected Reader charStream?
Explain the difference between BaseRowSetpublic BaseRowSet()?
Explain the difference between initParamsprotected void initParams()?
Explain about addRowSetListenerpublic void addRowSetListener(RowSetListener listener)?
Explain about removeRowSetListenerpublic void removeRowSetListener(RowSetListener listener)?
Explain notifyCursorMovedprotected void notifyCursorMoved()                          throws SQLException?
Explain notifyRowChangedprotected void notifyRowChanged()                         throws SQLException?
Explain notifyRowSetChangedprotected void notifyRowSetChanged()                            throws SQLException?
Explain getCommandpublic String getCommand()
Explain about public void setCommand(String cmd)                throws SQLException
Explain about public String getUrl()              throws SQLException?
Explain about setUrlpublic void setUrl(String url)            throws SQLException?
Explain getDataSourceNamepublic String getDataSourceName()?
Explain setDataSourceNamepublic void setDataSourceName(String name)                       throws SQLException ?
Explain getUsernamepublic String getUsername( ) ?
Explain setUsernamepublic void setUsername(String name)?
Explain getPasswordpublic String getPassword()?
Explain method setPasswordpublic void setPassword(String pass)?
Explain method setTypepublic void setType(int type)             throws SQLException ?
Explain method getTypepublic int getType()            throws SQLException ?
Explain method setConcurrencypublic void setConcurrency(int concurrency)                    throws SQLException ?
Explain method isReadOnlypublic boolean isReadOnly()?
Explain method setReadOnlypublic void setReadOnly(boolean value) ?
Explain method getTransactionIsolationpublic int getTransactionIsolation() ?
Explain method setTransactionIsolationPublic void setTransactionIsolation(int level)                             throws SQLException
Explain method getTypeMappublic Map<String,Class<?>> getTypeMap()?
Explain method setTypeMappublic void setTypeMap(Map<String,Class<?>> map)?
Explain method getMaxFieldSizepublic int getMaxFieldSize()                    throws SQLException?
Explain method setMaxFieldSizepublic void setMaxFieldSize(int max)                     throws SQLException ?
Explain method getMaxRowspublic int getMaxRows()               throws SQLException?
Explain method setMaxRowspublic void setMaxRows(int max)                throws SQLException?
Explain method setEscapeProcessingpublic void setEscapeProcessing(boolean enable)                         throws SQLException ?
Explain method getQueryTimeoutpublic int getQueryTimeout()                    throws SQLException ?
Explain setQueryTimeoutpublic void setQueryTimeout(int seconds)                     throws SQLException ?
Explain method getShowDeletedpublic boolean getShowDeleted()                       throws SQLException ?
Explain public void setShowDeleted(boolean value)                    throws SQLException ?
Explain method getEscapeProcessingpublic boolean getEscapeProcessing()                            throws SQLException ?
Explain method setFetchDirectionpublic void setFetchDirection(int direction)                       throws SQLException ?
Explain method getFetchDirectionpublic int getFetchDirection()                      throws SQLException ?
Explain method setFetchSizepublic void setFetchSize(int rows)                  throws SQLException ?
Explain method getFetchSizepublic int getFetchSize()                 throws SQLException ?
Explain method getConcurrencypublic int getConcurrency()                   throws SQLException ?