<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6594522765263851820</id><updated>2012-01-19T02:45:23.642-08:00</updated><category term='external procedure'/><category term='sql procedure'/><category term='Scalar functions of java'/><category term='session pattern in java'/><category term='java'/><category term='variables in stored procedures'/><category term='stored procedure'/><category term='java virtual machine'/><category term='C program'/><category term='stored sql procedure'/><category term='stored procedures in java'/><category term='result set in stored procedure'/><category term='Frame Class'/><category term='interrupted execeptions'/><category term='jvm'/><category term='C programming'/><category term='cookie'/><title type='text'>ComputerCourse</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>76</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-8418904238276116185</id><published>2009-01-26T23:40:00.000-08:00</published><updated>2009-01-27T00:18:49.487-08:00</updated><title type='text'>java.sql Interface PreparedStatement</title><content type='html'>&lt;span style="font-weight: bold;"&gt;public abstract interface PreparedStatement&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;extends Statement&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An object that represents a precompiled SQL statement.&lt;br /&gt;&lt;br /&gt;A SQL statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.&lt;br /&gt;&lt;br /&gt;Note: The setXXX methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type Integer, then the method setInt should be used.&lt;br /&gt;&lt;br /&gt;If arbitrary parameter type conversions are required, the method setObject should be used with a target SQL type.&lt;br /&gt;Example of setting a parameter; con is an active connection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                     SET SALARY = ? WHERE ID = ?");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   pstmt.setBigDecimal(1, 153833.00)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   pstmt.setInt(2, 110592)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Connection.prepareStatement(java.lang.String), ResultSet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Method Detail&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;executeQuery&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public ResultSet executeQuery()&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Executes the SQL query in this PreparedStatement object and returns the result set generated by the query.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a ResultSet that contains the data produced by the query; never null&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;executeUpdate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public int executeUpdate()&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Executes the SQL INSERT, UPDATE or DELETE statement in this PreparedStatement object. In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        either the row count for INSERT, UPDATE or DELETE statements; or 0 for SQL statements that return nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setNull&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setNull(int parameterIndex,int sqlType) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to SQL NULL.&lt;br /&gt;&lt;br /&gt;   Note: You must specify the parameter's SQL type.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        sqlType - the SQL type code defined in java.sql.Types&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setBoolean&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setBoolean(int parameterIndex,&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;boolean x)&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java boolean value. The driver converts this to an SQL BIT value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setByte&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setByte(int parameterIndex,byte x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java byte value. The driver converts this to an SQL TINYINT value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setShort&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setShort(int parameterIndex,short x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java short value. The driver converts this to an SQL SMALLINT value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setInt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setInt(int parameterIndex,int x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java int value. The driver converts this to an SQL INTEGER value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setLong&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setLong(int parameterIndex,long x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java long value. The driver converts this to an SQL BIGINT value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setFloat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setFloat(int parameterIndex,float x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java float value. The driver converts this to an SQL FLOAT value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setDouble&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setDouble(int parameterIndex,double x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java double value. The driver converts this to an SQL DOUBLE value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setBigDecimal&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setBigDecimal(int parameterIndex,BigDecimal x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a java.lang.BigDecimal value. The driver converts this to an SQL NUMERIC value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setString&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setString(int parameterIndex,String x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java String value. The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHARs) when it sends it to the database.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setBytes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setBytes(int parameterIndex,byte[] x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a Java array of bytes. The driver converts this to an SQL VARBINARY or LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARYs) when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr style="font-style: italic; font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setDate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setDate(int parameterIndex,Date x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a java.sql.Date value. The driver converts this to an SQL DATE value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setTime&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setTime(int parameterIndex,Time x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a java.sql.Time value. The driver converts this to an SQL TIME value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setTimestamp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setTimestamp(int parameterIndex,Timestamp x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to a java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP value when it sends it to the database.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setAsciiStream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setAsciiStream(int parameterIndex,InputStream x,int length) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from ASCII to the database char format.&lt;br /&gt;&lt;br /&gt;   Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the Java input stream that contains the ASCII parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        length - the number of bytes in the stream&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setUnicodeStream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setUnicodeStream(int parameterIndex,InputStream x,int length)throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Deprecated. &lt;br /&gt;   Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format. The byte format of the Unicode stream must be Java UTF-8, as defined in the Java Virtual Machine Specification.&lt;br /&gt;&lt;br /&gt;   Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the java input stream which contains the UNICODE parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        length - the number of bytes in the stream&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setBinaryStream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setBinaryStream(int parameterIndex,&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;InputStream x,&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;int length)&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.&lt;br /&gt;&lt;br /&gt;   Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the java input stream which contains the binary parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        length - the number of bytes in the stream&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;clearParameters&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void clearParameters() throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Clears the current parameter values immediately.&lt;br /&gt;&lt;br /&gt;   In general, parameter values remain in force for repeated use of a Statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setObject&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setObject(int parameterIndex,Object x,int targetSqlType,int scale)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;               throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the value of a parameter using an object. The second argument must be an object type; for integral values, the java.lang equivalent objects should be used.&lt;br /&gt;&lt;br /&gt;   The given Java object will be converted to the targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing SQLData), the JDBC driver should call its method writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, Struct, or Array, the driver should pass it to the database as a value of the corresponding SQL type.&lt;br /&gt;&lt;br /&gt;   Note that this method may be used to pass datatabase- specific abstract data types.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the object containing the input parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other types, this value will be ignored.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        Types&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setObject&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setObject(int parameterIndex,Object x,int targetSqlType) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the value of the designated parameter with the given object. This method is like setObject above, except that it assumes a scale of zero.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the object containing the input parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setObject&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setObject(int parameterIndex,&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Object x)&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Sets the value of a parameter using an object; use the java.lang equivalent objects for integral values.&lt;br /&gt;&lt;br /&gt;   The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.&lt;br /&gt;&lt;br /&gt;   Note that this method may be used to pass datatabase- specific abstract data types, by using a Driver-specific Java type. If the object is of a class implementing SQLData, the JDBC driver should call its method writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, Struct, or Array, then the driver should pass it to the database as a value of the corresponding SQL type. This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of those interfaces.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the object containing the input parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;execute&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public boolean execute() throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Executes any kind of SQL statement. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        Statement.execute(java.lang.String)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;addBatch&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void addBatch() throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Adds a set of parameters to the batch.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        Statement.addBatch(java.lang.String)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setCharacterStream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setCharacterStream(int parameterIndex,Reader reader,int length)  throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets the designated parameter to the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.&lt;br /&gt;&lt;br /&gt;   Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the java reader which contains the UNICODE data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        length - the number of characters in the stream&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setRef&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setRef(int i,Ref x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets a REF(&lt;structured-type&gt;) parameter.&lt;br /&gt;&lt;br /&gt;   Parameters:&lt;br /&gt;       i - the first parameter is 1, the second is 2, ...&lt;br /&gt;       x - an object representing data of an SQL REF Type&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setBlob&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setBlob(int i,Blob x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets a BLOB parameter.&lt;br /&gt;&lt;br /&gt;   Parameters:&lt;br /&gt;       i - the first parameter is 1, the second is 2, ...&lt;br /&gt;       x - an object representing a BLOB&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setClob&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setClob(int i,Clob x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets a CLOB parameter.&lt;br /&gt;&lt;br /&gt;   Parameters:&lt;br /&gt;       i - the first parameter is 1, the second is 2, ...&lt;br /&gt;       x - an object representing a CLOB&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setArray&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setArray(int i,Array x) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets an Array parameter.&lt;br /&gt;&lt;br /&gt;   Parameters:&lt;br /&gt;       i - the first parameter is 1, the second is 2, ...&lt;br /&gt;       x - an object representing an SQL array&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getMetaData&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public ResultSetMetaData getMetaData() throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Gets the number, types and properties of a ResultSet's columns.&lt;br /&gt;&lt;br /&gt;   Returns:&lt;br /&gt;       the description of a ResultSet's columns&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setDate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setDate(int parameterIndex,Date x,Calendar cal) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets the designated parameter to a java.sql.Date value, using the given Calendar object. The driver uses the Calendar object to construct an SQL DATE, which the driver then sends to the database. With a a Calendar object, the driver can calculate the date taking into account a custom timezone and locale. If no Calendar object is specified, the driver uses the default timezone and locale.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        cal - the Calendar object the driver will use to construct the date&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setTime&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setTime(int parameterIndex,Time x,Calendar cal) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets the designated parameter to a java.sql.Time value, using the given Calendar object. The driver uses the Calendar object to construct an SQL TIME, which the driver then sends to the database. With a a Calendar object, the driver can calculate the time taking into account a custom timezone and locale. If no Calendar object is specified, the driver uses the default timezone and locale.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        cal - the Calendar object the driver will use to construct the time&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setTimestamp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setTimestamp(int parameterIndex,Timestamp x,Calendar cal) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets the designated parameter to a java.sql.Timestamp value, using the given Calendar object. The driver uses the Calendar object to construct an SQL TIMESTAMP, which the driver then sends to the database. With a a Calendar object, the driver can calculate the timestamp taking into account a custom timezone and locale. If no Calendar object is specified, the driver uses the default timezone and locale.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        x - the parameter value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        cal - the Calendar object the driver will use to construct the timestamp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;setNull&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public void setNull(int paramIndex,int sqlType,String typeName) throws SQLException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   JDBC 2.0 Sets the designated parameter to SQL NULL. This version of setNull should be used for user-named types and REF type parameters. Examples of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.&lt;br /&gt;&lt;br /&gt;   Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-named type the name is the type name of the parameter itself. For a REF parameter the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-named and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-named or REF type, the given typeName is ignored.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        parameterIndex - the first parameter is 1, the second is 2, ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        sqlType - a value from java.sql.Types&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        typeName - the fully-qualified name of an SQL user-named type, ignored if the parameter is not a user-named type or REF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        SQLException - if a database access error occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/structured-type&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-8418904238276116185?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/8418904238276116185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=8418904238276116185' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/8418904238276116185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/8418904238276116185'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2009/01/javasql-interface-preparedstatement.html' title='java.sql Interface PreparedStatement'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2260591838648583287</id><published>2009-01-26T06:13:00.000-08:00</published><updated>2009-01-26T06:51:22.660-08:00</updated><title type='text'>javax.servlet - Interface ServletRequest</title><content type='html'>&lt;span style="color: rgb(204, 0, 0);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;Method Detail&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getAttribute&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public Object getAttribute(String name)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.&lt;br /&gt;&lt;br /&gt;Attributes can be set two ways. The servlet container may set attributes to make available custom information about a request. For example, for requests made using HTTPS, the attribute javax.servlet.request.X509Certificate can be used to retrieve information on the certificate of the client. Attributes can also be set programatically using setAttribute(java.lang.String, java.lang.Object). This allows information to be embedded into a request before a RequestDispatcher call.&lt;br /&gt;&lt;br /&gt;Attribute names should follow the same conventions as package names. This specification reserves names matching java.*, javax.*, and sun.*.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        name - a String specifying the name of the attribute &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an Object containing the value of the attribute, or null if the attribute does not exist&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getAttributeNames&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public Enumeration getAttributeNames()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an Enumeration of strings containing the names of the request's attributes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getCharacterEncoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getCharacterEncoding()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setCharacterEncoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setCharacterEncoding(String env)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;                          throws UnsupportedEncodingException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader().&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        env - a String containing the name of the chararacter encoding. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        UnsupportedEncodingException - if this is not a valid encoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getContentLength&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public int getContentLength()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_LENGTH.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an integer containing the length of the request body or -1 if the length is not known&lt;/span&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getContentType&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getContentType()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the MIME type of the body of the request, or null if the type is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_TYPE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the name of the MIME type of the request, or null if the type is not known&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getInputStream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public ServletInputStream getInputStream()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;                                  throws IOException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Retrieves the body of the request as binary data using a ServletInputStream. Either this method or getReader() may be called to read the body, not both.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a ServletInputStream object containing the body of the request &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        IllegalStateException - if the getReader() method has already been called for this request &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        IOException - if an input or output exception occurred&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getParameter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getParameter(String name)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.&lt;br /&gt;&lt;br /&gt;You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).&lt;br /&gt;&lt;br /&gt;If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.&lt;br /&gt;&lt;br /&gt;If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream() or getReader() can interfere with the execution of this method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        name - a String specifying the name of the parameter &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String representing the single value of the parameter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        getParameterValues(java.lang.String)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getParameterNames&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public Enumeration getParameterNames()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters&lt;/span&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getParameterValues&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String[] getParameterValues(String name)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.&lt;br /&gt;&lt;br /&gt;If the parameter has a single value, the array has a length of 1.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        name - a String containing the name of the parameter whose value is requested&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an array of String objects containing the parameter's values&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        getParameter(java.lang.String)&lt;/span&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;getParameterMap&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public Map getParameterMap()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getProtocol&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getProtocol()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets, the value returned is the same as the value of the CGI variable SERVER_PROTOCOL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the protocol name and version number&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getScheme&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getScheme()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the name of the scheme used to make this request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;getServerName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;public String getServerName()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header, if any, or the resolved server name, or the server IP address.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the name of the server&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getServerPort&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public int getServerPort()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the port number to which the request was sent. It is the value of the part after ":" in the Host header, if any, or the server port where the client connection was accepted on.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an integer specifying the port number&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getReader&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public BufferedReader getReader()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;                         throws IOException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Retrieves the body of the request as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or getInputStream() may be called to read the body, not both.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a BufferedReader containing the body of the request &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Throws:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        UnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decoded &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        IllegalStateException - if getInputStream() method has been called on this request &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        IOException - if an input or output exception occurred&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        getInputStream()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getRemoteAddr&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getRemoteAddr()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the IP address of the client that sent the request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getRemoteHost&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getRemoteHost()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the fully qualified name of the client&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;setAttribute&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void setAttribute(String name,Object o)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher.&lt;br /&gt;&lt;br /&gt;Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.&lt;br /&gt;If the object passed in is null, the effect is the same as calling removeAttribute(java.lang.String).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        name - a String specifying the name of the attribute&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        o - the Object to be stored&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;removeAttribute&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public void removeAttribute(String name)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Removes an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.&lt;br /&gt;&lt;br /&gt;Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        name - a String specifying the name of the attribute to remove&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getLocale&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public Locale getLocale()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        the preferred Locale for the client&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getLocales&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public Enumeration getLocales()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale, the default locale for the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an Enumeration of preferred Locale objects for the client&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;isSecure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public boolean isSecure()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a boolean indicating if the request was made using a secure channel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getRequestDispatcher&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public RequestDispatcher getRequestDispatcher(String path)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.&lt;br /&gt;&lt;br /&gt;  The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher.&lt;br /&gt;&lt;br /&gt;  The difference between this method and ServletContext.getRequestDispatcher(java.lang.String) is that this method can take a relative path.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the servlet container cannot return a RequestDispatcher&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    See Also:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        RequestDispatcher, ServletContext.getRequestDispatcher(java.lang.String)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getRealPath&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getRealPath(String path)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getRemotePort&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public int getRemotePort()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Since:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        2.4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getLocalName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getLocalName()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Returns the host name of the Internet Protocol (IP) interface on which the request was received.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the host name of the IP on which the request was received.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Since:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        2.4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getLocalAddr&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public String getLocalAddr()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Returns the Internet Protocol (IP) address of the interface on which the request was received.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        a String containing the IP address on which the request was received.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Since:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        2.4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;getLocalPort&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;public int getLocalPort()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   Returns the Internet Protocol (IP) port number of the interface on which the request was received.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Returns:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        an integer specifying the port number&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Since:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        2.4&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2260591838648583287?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2260591838648583287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2260591838648583287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2260591838648583287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2260591838648583287'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2009/01/javaxservlet-interface-servletrequest.html' title='javax.servlet - Interface ServletRequest'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-3910275616118468906</id><published>2008-12-17T04:24:00.000-08:00</published><updated>2008-12-17T04:39:32.443-08:00</updated><title type='text'>Input-Stream Figure</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_h2l5UCqUCAU/SUjysZ5PU9I/AAAAAAAAFn0/8gOeKtKPrUw/s1600-h/inputstream.jpg"&gt;&lt;img style="cursor: pointer; width: 478px; height: 296px;" src="http://3.bp.blogspot.com/_h2l5UCqUCAU/SUjysZ5PU9I/AAAAAAAAFn0/8gOeKtKPrUw/s320/inputstream.jpg" alt="" id="BLOGGER_PHOTO_ID_5280737407771038674" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-3910275616118468906?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/3910275616118468906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=3910275616118468906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/3910275616118468906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/3910275616118468906'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/12/input-stream-figure.html' title='Input-Stream Figure'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_h2l5UCqUCAU/SUjysZ5PU9I/AAAAAAAAFn0/8gOeKtKPrUw/s72-c/inputstream.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1535749794638051362</id><published>2008-11-27T10:08:00.000-08:00</published><updated>2008-11-27T10:10:38.271-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frame Class'/><title type='text'>API of Frame Class</title><content type='html'>&lt;h2&gt; &lt;span style="font-size:-1;"&gt; java.awt&lt;/span&gt;&lt;br /&gt;Class Frame&lt;/h2&gt; &lt;pre&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html" title="class in java.lang"&gt;java.lang.Object&lt;/a&gt;&lt;br /&gt; &lt;img src="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/resources/inherit.gif" alt="extended by " /&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html" title="class in java.awt"&gt;java.awt.Component&lt;/a&gt;&lt;br /&gt;     &lt;img src="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/resources/inherit.gif" alt="extended by " /&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html" title="class in java.awt"&gt;java.awt.Container&lt;/a&gt;&lt;br /&gt;         &lt;img src="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/resources/inherit.gif" alt="extended by " /&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;java.awt.Window&lt;/a&gt;&lt;br /&gt;             &lt;img src="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/resources/inherit.gif" alt="extended by " /&gt;&lt;b&gt;java.awt.Frame&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dt&gt;&lt;b&gt;All Implemented Interfaces:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html" title="interface in java.awt.image"&gt;ImageObserver&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html" title="interface in java.awt"&gt;MenuContainer&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/io/Serializable.html" title="interface in java.io"&gt;Serializable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/accessibility/Accessible.html" title="interface in javax.accessibility"&gt;Accessible&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;dl&gt;&lt;dt&gt;&lt;b&gt;Direct Known Subclasses:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/swing/JFrame.html" title="class in javax.swing"&gt;JFrame&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt; &lt;dl&gt;&lt;dt&gt;&lt;pre&gt;public class &lt;b&gt;Frame&lt;/b&gt;&lt;dt&gt;extends &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;implements &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html" title="interface in java.awt"&gt;MenuContainer&lt;/a&gt;&lt;/dt&gt;&lt;/pre&gt;&lt;/dt&gt;&lt;/dl&gt;   &lt;p&gt; A &lt;code&gt;Frame&lt;/code&gt; is a top-level window with a title and a border.  &lt;/p&gt;&lt;p&gt;  The size of the frame includes any area designated for the  border.  The dimensions of the border area may be obtained   using the &lt;code&gt;getInsets&lt;/code&gt; method, however, since   these dimensions are platform-dependent, a valid insets  value cannot be obtained until the frame is made displayable  by either calling &lt;code&gt;pack&lt;/code&gt; or &lt;code&gt;show&lt;/code&gt;.   Since the border area is included in the overall size of the  frame, the border effectively obscures a portion of the frame,  constraining the area available for rendering and/or displaying  subcomponents to the rectangle which has an upper-left corner  location of &lt;code&gt;(insets.left, insets.top)&lt;/code&gt;, and has a size of  &lt;code&gt;width - (insets.left + insets.right)&lt;/code&gt; by   &lt;code&gt;height - (insets.top + insets.bottom)&lt;/code&gt;.   &lt;/p&gt;&lt;p&gt;  The default layout for a frame is &lt;code&gt;BorderLayout&lt;/code&gt;.  &lt;/p&gt;&lt;p&gt;  A frame may have its native decorations (i.e. &lt;code&gt;Frame&lt;/code&gt;  and &lt;code&gt;Titlebar&lt;/code&gt;) turned off  with &lt;code&gt;setUndecorated&lt;/code&gt;. This can only be done while the frame  is not &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDisplayable%28%29"&gt;&lt;code&gt;displayable&lt;/code&gt;&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt;  In a multi-screen environment, you can create a &lt;code&gt;Frame&lt;/code&gt;  on a different screen device by constructing the &lt;code&gt;Frame&lt;/code&gt;  with &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28java.awt.GraphicsConfiguration%29"&gt;&lt;code&gt;Frame(GraphicsConfiguration)&lt;/code&gt;&lt;/a&gt; or  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28java.lang.String,%20java.awt.GraphicsConfiguration%29"&gt;&lt;code&gt;Frame(String title, GraphicsConfiguration)&lt;/code&gt;&lt;/a&gt;.  The  &lt;code&gt;GraphicsConfiguration&lt;/code&gt; object is one of the  &lt;code&gt;GraphicsConfiguration&lt;/code&gt; objects of the target screen  device.  &lt;/p&gt;&lt;p&gt;  In a virtual device multi-screen environment in which the desktop  area could span multiple physical screen devices, the bounds of all  configurations are relative to the virtual-coordinate system.  The  origin of the virtual-coordinate system is at the upper left-hand  corner of the primary physical screen.  Depending on the location  of the primary screen in the virtual device, negative coordinates  are possible, as shown in the following figure.  &lt;/p&gt;&lt;p&gt;  &lt;img src="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/doc-files/MultiScreen.gif" alt="Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen  shows (0,0) coords while a different physical screen shows (-80,-100) coords." vspace="7" align="center" hspace="10" /&gt;  &lt;/p&gt;&lt;p&gt;  In such an environment, when calling &lt;code&gt;setLocation&lt;/code&gt;,   you must pass a virtual coordinate to this method.  Similarly,   calling &lt;code&gt;getLocationOnScreen&lt;/code&gt; on a &lt;code&gt;Frame&lt;/code&gt;  returns virtual device coordinates.  Call the &lt;code&gt;getBounds&lt;/code&gt;  method of a &lt;code&gt;GraphicsConfiguration&lt;/code&gt; to find its origin in  the virtual coordinate system.  &lt;/p&gt;&lt;p&gt;  The following code sets the  location of the &lt;code&gt;Frame&lt;/code&gt; at (10, 10) relative  to the origin of the physical screen of the corresponding  &lt;code&gt;GraphicsConfiguration&lt;/code&gt;.  If the bounds of the  &lt;code&gt;GraphicsConfiguration&lt;/code&gt; is not taken into account, the  &lt;code&gt;Frame&lt;/code&gt; location would be set at (10, 10) relative to the  virtual-coordinate system and would appear on the primary physical  screen, which might be different from the physical screen of the  specified &lt;code&gt;GraphicsConfiguration&lt;/code&gt;.   &lt;/p&gt;&lt;pre&gt;      Frame f = new Frame(GraphicsConfiguration gc);&lt;br /&gt;     Rectangle bounds = gc.getBounds();&lt;br /&gt;     f.setLocation(10 + bounds.x, 10 + bounds.y);&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;  Frames are capable of generating the following types of  &lt;code&gt;WindowEvent&lt;/code&gt;s:  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;WINDOW_OPENED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_CLOSING&lt;/code&gt;:     &lt;br /&gt;If the program doesn't      explicitly hide or dispose the window while processing      this event, the window close operation is canceled.  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_CLOSED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_ICONIFIED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_DEICONIFIED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_ACTIVATED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_DEACTIVATED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_GAINED_FOCUS&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_LOST_FOCUS&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;WINDOW_STATE_CHANGED&lt;/code&gt;  &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;JDK1.0&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/event/WindowEvent.html" title="class in java.awt.event"&gt;&lt;code&gt;WindowEvent&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addWindowListener%28java.awt.event.WindowListener%29"&gt;&lt;code&gt;Window.addWindowListener(java.awt.event.WindowListener)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/serialized-form.html#java.awt.Frame"&gt;Serialized Form&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;p&gt; &lt;!-- ======== NESTED CLASS SUMMARY ======== --&gt;  &lt;a name="nested_class_summary"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;/p&gt;&lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="2" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Nested Class Summary&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;protected  class&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.AccessibleAWTFrame.html" title="class in java.awt"&gt;Frame.AccessibleAWTFrame&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          This class implements accessibility support for the   &lt;code&gt;Frame&lt;/code&gt; class.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="nested_classes_inherited_from_class_java.awt.Window"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Nested classes/interfaces inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.AccessibleAWTWindow.html" title="class in java.awt"&gt;Window.AccessibleAWTWindow&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;a name="nested_classes_inherited_from_class_java.awt.Container"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Nested classes/interfaces inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html" title="class in java.awt"&gt;Container&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.AccessibleAWTContainer.html" title="class in java.awt"&gt;Container.AccessibleAWTContainer&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;a name="nested_classes_inherited_from_class_java.awt.Component"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Nested classes/interfaces inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html" title="class in java.awt"&gt;Component&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.AccessibleAWTComponent.html" title="class in java.awt"&gt;Component.AccessibleAWTComponent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.BltBufferStrategy.html" title="class in java.awt"&gt;Component.BltBufferStrategy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.FlipBufferStrategy.html" title="class in java.awt"&gt;Component.FlipBufferStrategy&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;!-- =========== FIELD SUMMARY =========== --&gt;  &lt;a name="field_summary"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="2" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Field Summary&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#CROSSHAIR_CURSOR"&gt;CROSSHAIR_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.CROSSHAIR_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#DEFAULT_CURSOR"&gt;DEFAULT_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.DEFAULT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#E_RESIZE_CURSOR"&gt;E_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.E_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#HAND_CURSOR"&gt;HAND_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.HAND_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#ICONIFIED"&gt;ICONIFIED&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          This state bit indicates that frame is iconified.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#MAXIMIZED_BOTH"&gt;MAXIMIZED_BOTH&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          This state bit mask indicates that frame is fully maximized  (that is both horizontally and vertically).&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#MAXIMIZED_HORIZ"&gt;MAXIMIZED_HORIZ&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          This state bit indicates that frame is maximized in the  horizontal direction.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#MAXIMIZED_VERT"&gt;MAXIMIZED_VERT&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          This state bit indicates that frame is maximized in the  vertical direction.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#MOVE_CURSOR"&gt;MOVE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.MOVE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#N_RESIZE_CURSOR"&gt;N_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.N_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#NE_RESIZE_CURSOR"&gt;NE_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.NE_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#NORMAL"&gt;NORMAL&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          Frame is in the "normal" state.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#NW_RESIZE_CURSOR"&gt;NW_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.NW_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#S_RESIZE_CURSOR"&gt;S_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.S_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#SE_RESIZE_CURSOR"&gt;SE_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.SE_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#SW_RESIZE_CURSOR"&gt;SW_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.SW_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#TEXT_CURSOR"&gt;TEXT_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.TEXT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#W_RESIZE_CURSOR"&gt;W_RESIZE_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.W_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#WAIT_CURSOR"&gt;WAIT_CURSOR&lt;/a&gt;&lt;/b&gt;&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.WAIT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="fields_inherited_from_class_java.awt.Component"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Fields inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html" title="class in java.awt"&gt;Component&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#BOTTOM_ALIGNMENT"&gt;BOTTOM_ALIGNMENT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#CENTER_ALIGNMENT"&gt;CENTER_ALIGNMENT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#LEFT_ALIGNMENT"&gt;LEFT_ALIGNMENT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#RIGHT_ALIGNMENT"&gt;RIGHT_ALIGNMENT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#TOP_ALIGNMENT"&gt;TOP_ALIGNMENT&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="fields_inherited_from_class_java.awt.image.ImageObserver"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Fields inherited from interface java.awt.image.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html" title="interface in java.awt.image"&gt;ImageObserver&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#ABORT"&gt;ABORT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#ALLBITS"&gt;ALLBITS&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#ERROR"&gt;ERROR&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#FRAMEBITS"&gt;FRAMEBITS&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#HEIGHT"&gt;HEIGHT&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#PROPERTIES"&gt;PROPERTIES&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#SOMEBITS"&gt;SOMEBITS&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/image/ImageObserver.html#WIDTH"&gt;WIDTH&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;!-- ======== CONSTRUCTOR SUMMARY ======== --&gt;  &lt;a name="constructor_summary"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="2" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Constructor Summary&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28%29"&gt;Frame&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Constructs a new instance of &lt;code&gt;Frame&lt;/code&gt; that is   initially invisible.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28java.awt.GraphicsConfiguration%29"&gt;Frame&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html" title="class in java.awt"&gt;GraphicsConfiguration&lt;/a&gt; gc)&lt;/code&gt; &lt;br /&gt;          Create a &lt;code&gt;Frame&lt;/code&gt; with the specified   &lt;code&gt;GraphicsConfiguration&lt;/code&gt; of  a screen device.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28java.lang.String%29"&gt;Frame&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title)&lt;/code&gt; &lt;br /&gt;          Constructs a new, initially invisible &lt;code&gt;Frame&lt;/code&gt; object   with the specified title.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#Frame%28java.lang.String,%20java.awt.GraphicsConfiguration%29"&gt;Frame&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title,       &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html" title="class in java.awt"&gt;GraphicsConfiguration&lt;/a&gt; gc)&lt;/code&gt; &lt;br /&gt;          Constructs a new, initially invisible &lt;code&gt;Frame&lt;/code&gt; object   with the specified title and a   &lt;code&gt;GraphicsConfiguration&lt;/code&gt;.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;!-- ========== METHOD SUMMARY =========== --&gt;  &lt;a name="method_summary"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="2" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Method Summary&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#addNotify%28%29"&gt;addNotify&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Makes this Frame displayable by connecting it to  a native screen resource.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;protected  void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#finalize%28%29"&gt;finalize&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Disposes of the input methods and context, and removes   this Frame from the AppContext.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/accessibility/AccessibleContext.html" title="class in javax.accessibility"&gt;AccessibleContext&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getAccessibleContext%28%29"&gt;getAccessibleContext&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the AccessibleContext associated with this Frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getCursorType%28%29"&gt;getCursorType&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;As of JDK version 1.1,  replaced by &lt;code&gt;Component.getCursor()&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;getExtendedState&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the state of this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;static &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html" title="class in java.awt"&gt;Frame&lt;/a&gt;[]&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getFrames%28%29"&gt;getFrames&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Returns an array containing all Frames created by the application.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Image.html" title="class in java.awt"&gt;Image&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getIconImage%28%29"&gt;getIconImage&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the image to be displayed in the minimized icon  for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Rectangle.html" title="class in java.awt"&gt;Rectangle&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getMaximizedBounds%28%29"&gt;getMaximizedBounds&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets maximized bounds for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuBar.html" title="class in java.awt"&gt;MenuBar&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getMenuBar%28%29"&gt;getMenuBar&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the menu bar for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; int&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getState%28%29"&gt;getState&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the state of this frame (obsolete).&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getTitle%28%29"&gt;getTitle&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Gets the title of the frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; boolean&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#isResizable%28%29"&gt;isResizable&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Indicates whether this frame is resizable by the user.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; boolean&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#isUndecorated%28%29"&gt;isUndecorated&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Indicates whether this frame is undecorated.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt;protected  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#paramString%28%29"&gt;paramString&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Returns a string representing the state of this &lt;code&gt;Frame&lt;/code&gt;.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#remove%28java.awt.MenuComponent%29"&gt;remove&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuComponent.html" title="class in java.awt"&gt;MenuComponent&lt;/a&gt; m)&lt;/code&gt; &lt;br /&gt;          Removes the specified menu bar from this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bg style="color:white;"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#removeNotify%28%29"&gt;removeNotify&lt;/a&gt;&lt;/b&gt;()&lt;/code&gt; &lt;br /&gt;          Makes this Frame undisplayable by removing its connection  to its native screen resource.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setCursor%28int%29"&gt;setCursor&lt;/a&gt;&lt;/b&gt;(int cursorType)&lt;/code&gt; &lt;br /&gt;          &lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;As of JDK version 1.1,  replaced by &lt;code&gt;Component.setCursor(Cursor)&lt;/code&gt;.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;setExtendedState&lt;/a&gt;&lt;/b&gt;(int state)&lt;/code&gt; &lt;br /&gt;          Sets the state of this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setIconImage%28java.awt.Image%29"&gt;setIconImage&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Image.html" title="class in java.awt"&gt;Image&lt;/a&gt; image)&lt;/code&gt; &lt;br /&gt;          Sets the image to be displayed in the minimized icon for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setMaximizedBounds%28java.awt.Rectangle%29"&gt;setMaximizedBounds&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Rectangle.html" title="class in java.awt"&gt;Rectangle&lt;/a&gt; bounds)&lt;/code&gt; &lt;br /&gt;          Sets the maximized bounds for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setMenuBar%28java.awt.MenuBar%29"&gt;setMenuBar&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuBar.html" title="class in java.awt"&gt;MenuBar&lt;/a&gt; mb)&lt;/code&gt; &lt;br /&gt;          Sets the menu bar for this frame to the specified menu bar.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setResizable%28boolean%29"&gt;setResizable&lt;/a&gt;&lt;/b&gt;(boolean resizable)&lt;/code&gt; &lt;br /&gt;          Sets whether this frame is resizable by the user.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setState%28int%29"&gt;setState&lt;/a&gt;&lt;/b&gt;(int state)&lt;/code&gt; &lt;br /&gt;          Sets the state of this frame (obsolete).&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setTitle%28java.lang.String%29"&gt;setTitle&lt;/a&gt;&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title)&lt;/code&gt; &lt;br /&gt;          Sets the title for this frame to the specified string.&lt;/td&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td valign="top" width="1%" align="right"&gt;&lt;span style="font-size:-1;"&gt; &lt;code&gt; void&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;b&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setUndecorated%28boolean%29"&gt;setUndecorated&lt;/a&gt;&lt;/b&gt;(boolean undecorated)&lt;/code&gt; &lt;br /&gt;          Disables or enables decorations for this frame.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="methods_inherited_from_class_java.awt.Window"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Methods inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addPropertyChangeListener%28java.beans.PropertyChangeListener%29"&gt;addPropertyChangeListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addPropertyChangeListener%28java.lang.String,%20java.beans.PropertyChangeListener%29"&gt;addPropertyChangeListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addWindowFocusListener%28java.awt.event.WindowFocusListener%29"&gt;addWindowFocusListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addWindowListener%28java.awt.event.WindowListener%29"&gt;addWindowListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addWindowStateListener%28java.awt.event.WindowStateListener%29"&gt;addWindowStateListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#applyResourceBundle%28java.util.ResourceBundle%29"&gt;applyResourceBundle&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#applyResourceBundle%28java.lang.String%29"&gt;applyResourceBundle&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#createBufferStrategy%28int%29"&gt;createBufferStrategy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#createBufferStrategy%28int,%20java.awt.BufferCapabilities%29"&gt;createBufferStrategy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#dispose%28%29"&gt;dispose&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getBufferStrategy%28%29"&gt;getBufferStrategy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getFocusableWindowState%28%29"&gt;getFocusableWindowState&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getFocusCycleRootAncestor%28%29"&gt;getFocusCycleRootAncestor&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getFocusOwner%28%29"&gt;getFocusOwner&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getFocusTraversalKeys%28int%29"&gt;getFocusTraversalKeys&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getGraphicsConfiguration%28%29"&gt;getGraphicsConfiguration&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getInputContext%28%29"&gt;getInputContext&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getListeners%28java.lang.Class%29"&gt;getListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getLocale%28%29"&gt;getLocale&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getMostRecentFocusOwner%28%29"&gt;getMostRecentFocusOwner&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getOwnedWindows%28%29"&gt;getOwnedWindows&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getOwner%28%29"&gt;getOwner&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getToolkit%28%29"&gt;getToolkit&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getWarningString%28%29"&gt;getWarningString&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getWindowFocusListeners%28%29"&gt;getWindowFocusListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getWindowListeners%28%29"&gt;getWindowListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getWindowStateListeners%28%29"&gt;getWindowStateListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#hide%28%29"&gt;hide&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isActive%28%29"&gt;isActive&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isAlwaysOnTop%28%29"&gt;isAlwaysOnTop&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isFocusableWindow%28%29"&gt;isFocusableWindow&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isFocusCycleRoot%28%29"&gt;isFocusCycleRoot&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isFocused%28%29"&gt;isFocused&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isLocationByPlatform%28%29"&gt;isLocationByPlatform&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#isShowing%28%29"&gt;isShowing&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#pack%28%29"&gt;pack&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#postEvent%28java.awt.Event%29"&gt;postEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#processEvent%28java.awt.AWTEvent%29"&gt;processEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#processWindowEvent%28java.awt.event.WindowEvent%29"&gt;processWindowEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#processWindowFocusEvent%28java.awt.event.WindowEvent%29"&gt;processWindowFocusEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#processWindowStateEvent%28java.awt.event.WindowEvent%29"&gt;processWindowStateEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#removeWindowFocusListener%28java.awt.event.WindowFocusListener%29"&gt;removeWindowFocusListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#removeWindowListener%28java.awt.event.WindowListener%29"&gt;removeWindowListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#removeWindowStateListener%28java.awt.event.WindowStateListener%29"&gt;removeWindowStateListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setAlwaysOnTop%28boolean%29"&gt;setAlwaysOnTop&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setBounds%28int,%20int,%20int,%20int%29"&gt;setBounds&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setCursor%28java.awt.Cursor%29"&gt;setCursor&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setFocusableWindowState%28boolean%29"&gt;setFocusableWindowState&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setFocusCycleRoot%28boolean%29"&gt;setFocusCycleRoot&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setLocationByPlatform%28boolean%29"&gt;setLocationByPlatform&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#setLocationRelativeTo%28java.awt.Component%29"&gt;setLocationRelativeTo&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#show%28%29"&gt;show&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#toBack%28%29"&gt;toBack&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#toFront%28%29"&gt;toFront&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="methods_inherited_from_class_java.awt.Container"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Methods inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html" title="class in java.awt"&gt;Container&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#add%28java.awt.Component%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#add%28java.awt.Component,%20int%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#add%28java.awt.Component,%20java.lang.Object%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#add%28java.awt.Component,%20java.lang.Object,%20int%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#add%28java.lang.String,%20java.awt.Component%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#addContainerListener%28java.awt.event.ContainerListener%29"&gt;addContainerListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#addImpl%28java.awt.Component,%20java.lang.Object,%20int%29"&gt;addImpl&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#applyComponentOrientation%28java.awt.ComponentOrientation%29"&gt;applyComponentOrientation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#areFocusTraversalKeysSet%28int%29"&gt;areFocusTraversalKeysSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#countComponents%28%29"&gt;countComponents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#deliverEvent%28java.awt.Event%29"&gt;deliverEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#doLayout%28%29"&gt;doLayout&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#findComponentAt%28int,%20int%29"&gt;findComponentAt&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#findComponentAt%28java.awt.Point%29"&gt;findComponentAt&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getAlignmentX%28%29"&gt;getAlignmentX&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getAlignmentY%28%29"&gt;getAlignmentY&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponent%28int%29"&gt;getComponent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponentAt%28int,%20int%29"&gt;getComponentAt&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponentAt%28java.awt.Point%29"&gt;getComponentAt&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponentCount%28%29"&gt;getComponentCount&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponents%28%29"&gt;getComponents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getComponentZOrder%28java.awt.Component%29"&gt;getComponentZOrder&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getContainerListeners%28%29"&gt;getContainerListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getFocusTraversalPolicy%28%29"&gt;getFocusTraversalPolicy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getInsets%28%29"&gt;getInsets&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getLayout%28%29"&gt;getLayout&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getMaximumSize%28%29"&gt;getMaximumSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getMinimumSize%28%29"&gt;getMinimumSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getMousePosition%28boolean%29"&gt;getMousePosition&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#getPreferredSize%28%29"&gt;getPreferredSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#insets%28%29"&gt;insets&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#invalidate%28%29"&gt;invalidate&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#isAncestorOf%28java.awt.Component%29"&gt;isAncestorOf&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#isFocusCycleRoot%28java.awt.Container%29"&gt;isFocusCycleRoot&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#isFocusTraversalPolicyProvider%28%29"&gt;isFocusTraversalPolicyProvider&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#isFocusTraversalPolicySet%28%29"&gt;isFocusTraversalPolicySet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#layout%28%29"&gt;layout&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#list%28java.io.PrintStream,%20int%29"&gt;list&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#list%28java.io.PrintWriter,%20int%29"&gt;list&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#locate%28int,%20int%29"&gt;locate&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#minimumSize%28%29"&gt;minimumSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#paint%28java.awt.Graphics%29"&gt;paint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#paintComponents%28java.awt.Graphics%29"&gt;paintComponents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#preferredSize%28%29"&gt;preferredSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#print%28java.awt.Graphics%29"&gt;print&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#printComponents%28java.awt.Graphics%29"&gt;printComponents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#processContainerEvent%28java.awt.event.ContainerEvent%29"&gt;processContainerEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#remove%28java.awt.Component%29"&gt;remove&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#remove%28int%29"&gt;remove&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#removeAll%28%29"&gt;removeAll&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#removeContainerListener%28java.awt.event.ContainerListener%29"&gt;removeContainerListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setComponentZOrder%28java.awt.Component,%20int%29"&gt;setComponentZOrder&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setFocusTraversalKeys%28int,%20java.util.Set%29"&gt;setFocusTraversalKeys&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setFocusTraversalPolicy%28java.awt.FocusTraversalPolicy%29"&gt;setFocusTraversalPolicy&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setFocusTraversalPolicyProvider%28boolean%29"&gt;setFocusTraversalPolicyProvider&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setFont%28java.awt.Font%29"&gt;setFont&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#setLayout%28java.awt.LayoutManager%29"&gt;setLayout&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#transferFocusBackward%28%29"&gt;transferFocusBackward&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#transferFocusDownCycle%28%29"&gt;transferFocusDownCycle&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#update%28java.awt.Graphics%29"&gt;update&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#validate%28%29"&gt;validate&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#validateTree%28%29"&gt;validateTree&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="methods_inherited_from_class_java.awt.Component"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Methods inherited from class java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html" title="class in java.awt"&gt;Component&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#action%28java.awt.Event,%20java.lang.Object%29"&gt;action&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#add%28java.awt.PopupMenu%29"&gt;add&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addComponentListener%28java.awt.event.ComponentListener%29"&gt;addComponentListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addFocusListener%28java.awt.event.FocusListener%29"&gt;addFocusListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29"&gt;addHierarchyBoundsListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addHierarchyListener%28java.awt.event.HierarchyListener%29"&gt;addHierarchyListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addInputMethodListener%28java.awt.event.InputMethodListener%29"&gt;addInputMethodListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addKeyListener%28java.awt.event.KeyListener%29"&gt;addKeyListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addMouseListener%28java.awt.event.MouseListener%29"&gt;addMouseListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addMouseMotionListener%28java.awt.event.MouseMotionListener%29"&gt;addMouseMotionListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#addMouseWheelListener%28java.awt.event.MouseWheelListener%29"&gt;addMouseWheelListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#bounds%28%29"&gt;bounds&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#checkImage%28java.awt.Image,%20java.awt.image.ImageObserver%29"&gt;checkImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#checkImage%28java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver%29"&gt;checkImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#coalesceEvents%28java.awt.AWTEvent,%20java.awt.AWTEvent%29"&gt;coalesceEvents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#contains%28int,%20int%29"&gt;contains&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#contains%28java.awt.Point%29"&gt;contains&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#createImage%28java.awt.image.ImageProducer%29"&gt;createImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#createImage%28int,%20int%29"&gt;createImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#createVolatileImage%28int,%20int%29"&gt;createVolatileImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#createVolatileImage%28int,%20int,%20java.awt.ImageCapabilities%29"&gt;createVolatileImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#disable%28%29"&gt;disable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#disableEvents%28long%29"&gt;disableEvents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#dispatchEvent%28java.awt.AWTEvent%29"&gt;dispatchEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#enable%28%29"&gt;enable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#enable%28boolean%29"&gt;enable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#enableEvents%28long%29"&gt;enableEvents&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#enableInputMethods%28boolean%29"&gt;enableInputMethods&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20boolean,%20boolean%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20byte,%20byte%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20char,%20char%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20double,%20double%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20float,%20float%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20int,%20int%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20long,%20long%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20java.lang.Object,%20java.lang.Object%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20short,%20short%29"&gt;firePropertyChange&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getBackground%28%29"&gt;getBackground&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getBounds%28%29"&gt;getBounds&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getBounds%28java.awt.Rectangle%29"&gt;getBounds&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getColorModel%28%29"&gt;getColorModel&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getComponentListeners%28%29"&gt;getComponentListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getComponentOrientation%28%29"&gt;getComponentOrientation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getCursor%28%29"&gt;getCursor&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getDropTarget%28%29"&gt;getDropTarget&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getFocusListeners%28%29"&gt;getFocusListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getFocusTraversalKeysEnabled%28%29"&gt;getFocusTraversalKeysEnabled&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getFont%28%29"&gt;getFont&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getFontMetrics%28java.awt.Font%29"&gt;getFontMetrics&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getForeground%28%29"&gt;getForeground&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getGraphics%28%29"&gt;getGraphics&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getHeight%28%29"&gt;getHeight&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getHierarchyBoundsListeners%28%29"&gt;getHierarchyBoundsListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getHierarchyListeners%28%29"&gt;getHierarchyListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getIgnoreRepaint%28%29"&gt;getIgnoreRepaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getInputMethodListeners%28%29"&gt;getInputMethodListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getInputMethodRequests%28%29"&gt;getInputMethodRequests&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getKeyListeners%28%29"&gt;getKeyListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getLocation%28%29"&gt;getLocation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getLocation%28java.awt.Point%29"&gt;getLocation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getLocationOnScreen%28%29"&gt;getLocationOnScreen&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getMouseListeners%28%29"&gt;getMouseListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getMouseMotionListeners%28%29"&gt;getMouseMotionListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getMousePosition%28%29"&gt;getMousePosition&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getMouseWheelListeners%28%29"&gt;getMouseWheelListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getName%28%29"&gt;getName&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getParent%28%29"&gt;getParent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getPeer%28%29"&gt;getPeer&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getPropertyChangeListeners%28%29"&gt;getPropertyChangeListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getPropertyChangeListeners%28java.lang.String%29"&gt;getPropertyChangeListeners&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getSize%28%29"&gt;getSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getSize%28java.awt.Dimension%29"&gt;getSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getTreeLock%28%29"&gt;getTreeLock&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getWidth%28%29"&gt;getWidth&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getX%28%29"&gt;getX&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#getY%28%29"&gt;getY&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#gotFocus%28java.awt.Event,%20java.lang.Object%29"&gt;gotFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#handleEvent%28java.awt.Event%29"&gt;handleEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#hasFocus%28%29"&gt;hasFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#imageUpdate%28java.awt.Image,%20int,%20int,%20int,%20int,%20int%29"&gt;imageUpdate&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#inside%28int,%20int%29"&gt;inside&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isBackgroundSet%28%29"&gt;isBackgroundSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isCursorSet%28%29"&gt;isCursorSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDisplayable%28%29"&gt;isDisplayable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDoubleBuffered%28%29"&gt;isDoubleBuffered&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isEnabled%28%29"&gt;isEnabled&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isFocusable%28%29"&gt;isFocusable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isFocusOwner%28%29"&gt;isFocusOwner&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isFocusTraversable%28%29"&gt;isFocusTraversable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isFontSet%28%29"&gt;isFontSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isForegroundSet%28%29"&gt;isForegroundSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isLightweight%28%29"&gt;isLightweight&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isMaximumSizeSet%28%29"&gt;isMaximumSizeSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isMinimumSizeSet%28%29"&gt;isMinimumSizeSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isOpaque%28%29"&gt;isOpaque&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isPreferredSizeSet%28%29"&gt;isPreferredSizeSet&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isValid%28%29"&gt;isValid&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isVisible%28%29"&gt;isVisible&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#keyDown%28java.awt.Event,%20int%29"&gt;keyDown&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#keyUp%28java.awt.Event,%20int%29"&gt;keyUp&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#list%28%29"&gt;list&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#list%28java.io.PrintStream%29"&gt;list&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#list%28java.io.PrintWriter%29"&gt;list&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#location%28%29"&gt;location&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#lostFocus%28java.awt.Event,%20java.lang.Object%29"&gt;lostFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseDown%28java.awt.Event,%20int,%20int%29"&gt;mouseDown&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseDrag%28java.awt.Event,%20int,%20int%29"&gt;mouseDrag&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseEnter%28java.awt.Event,%20int,%20int%29"&gt;mouseEnter&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseExit%28java.awt.Event,%20int,%20int%29"&gt;mouseExit&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseMove%28java.awt.Event,%20int,%20int%29"&gt;mouseMove&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#mouseUp%28java.awt.Event,%20int,%20int%29"&gt;mouseUp&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#move%28int,%20int%29"&gt;move&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#nextFocus%28%29"&gt;nextFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#paintAll%28java.awt.Graphics%29"&gt;paintAll&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#prepareImage%28java.awt.Image,%20java.awt.image.ImageObserver%29"&gt;prepareImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#prepareImage%28java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver%29"&gt;prepareImage&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#printAll%28java.awt.Graphics%29"&gt;printAll&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processComponentEvent%28java.awt.event.ComponentEvent%29"&gt;processComponentEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processFocusEvent%28java.awt.event.FocusEvent%29"&gt;processFocusEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processHierarchyBoundsEvent%28java.awt.event.HierarchyEvent%29"&gt;processHierarchyBoundsEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processHierarchyEvent%28java.awt.event.HierarchyEvent%29"&gt;processHierarchyEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processInputMethodEvent%28java.awt.event.InputMethodEvent%29"&gt;processInputMethodEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processKeyEvent%28java.awt.event.KeyEvent%29"&gt;processKeyEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processMouseEvent%28java.awt.event.MouseEvent%29"&gt;processMouseEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processMouseMotionEvent%28java.awt.event.MouseEvent%29"&gt;processMouseMotionEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#processMouseWheelEvent%28java.awt.event.MouseWheelEvent%29"&gt;processMouseWheelEvent&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeComponentListener%28java.awt.event.ComponentListener%29"&gt;removeComponentListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeFocusListener%28java.awt.event.FocusListener%29"&gt;removeFocusListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29"&gt;removeHierarchyBoundsListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeHierarchyListener%28java.awt.event.HierarchyListener%29"&gt;removeHierarchyListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeInputMethodListener%28java.awt.event.InputMethodListener%29"&gt;removeInputMethodListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeKeyListener%28java.awt.event.KeyListener%29"&gt;removeKeyListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeMouseListener%28java.awt.event.MouseListener%29"&gt;removeMouseListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeMouseMotionListener%28java.awt.event.MouseMotionListener%29"&gt;removeMouseMotionListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removeMouseWheelListener%28java.awt.event.MouseWheelListener%29"&gt;removeMouseWheelListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removePropertyChangeListener%28java.beans.PropertyChangeListener%29"&gt;removePropertyChangeListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#removePropertyChangeListener%28java.lang.String,%20java.beans.PropertyChangeListener%29"&gt;removePropertyChangeListener&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#repaint%28%29"&gt;repaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#repaint%28int,%20int,%20int,%20int%29"&gt;repaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#repaint%28long%29"&gt;repaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#repaint%28long,%20int,%20int,%20int,%20int%29"&gt;repaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#requestFocus%28%29"&gt;requestFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#requestFocus%28boolean%29"&gt;requestFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#requestFocusInWindow%28%29"&gt;requestFocusInWindow&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#requestFocusInWindow%28boolean%29"&gt;requestFocusInWindow&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#reshape%28int,%20int,%20int,%20int%29"&gt;reshape&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#resize%28java.awt.Dimension%29"&gt;resize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#resize%28int,%20int%29"&gt;resize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setBackground%28java.awt.Color%29"&gt;setBackground&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setBounds%28java.awt.Rectangle%29"&gt;setBounds&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setComponentOrientation%28java.awt.ComponentOrientation%29"&gt;setComponentOrientation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setDropTarget%28java.awt.dnd.DropTarget%29"&gt;setDropTarget&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setEnabled%28boolean%29"&gt;setEnabled&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setFocusable%28boolean%29"&gt;setFocusable&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setFocusTraversalKeysEnabled%28boolean%29"&gt;setFocusTraversalKeysEnabled&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setForeground%28java.awt.Color%29"&gt;setForeground&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setIgnoreRepaint%28boolean%29"&gt;setIgnoreRepaint&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setLocale%28java.util.Locale%29"&gt;setLocale&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setLocation%28int,%20int%29"&gt;setLocation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setLocation%28java.awt.Point%29"&gt;setLocation&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setMaximumSize%28java.awt.Dimension%29"&gt;setMaximumSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setMinimumSize%28java.awt.Dimension%29"&gt;setMinimumSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setName%28java.lang.String%29"&gt;setName&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setPreferredSize%28java.awt.Dimension%29"&gt;setPreferredSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setSize%28java.awt.Dimension%29"&gt;setSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setSize%28int,%20int%29"&gt;setSize&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setVisible%28boolean%29"&gt;setVisible&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#show%28boolean%29"&gt;show&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#size%28%29"&gt;size&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#toString%28%29"&gt;toString&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#transferFocus%28%29"&gt;transferFocus&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#transferFocusUpCycle%28%29"&gt;transferFocusUpCycle&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="methods_inherited_from_class_java.lang.Object"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Methods inherited from class java.lang.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html" title="class in java.lang"&gt;Object&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#clone%28%29"&gt;clone&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#equals%28java.lang.Object%29"&gt;equals&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#getClass%28%29"&gt;getClass&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#hashCode%28%29"&gt;hashCode&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#notify%28%29"&gt;notify&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#notifyAll%28%29"&gt;notifyAll&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#wait%28%29"&gt;wait&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#wait%28long%29"&gt;wait&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Object.html#wait%28long,%20int%29"&gt;wait&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="methods_inherited_from_class_java.awt.MenuContainer"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableSubHeadingColor" bgcolor="#eeeeff"&gt; &lt;th align="left"&gt;&lt;b&gt;Methods inherited from interface java.awt.&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html" title="interface in java.awt"&gt;MenuContainer&lt;/a&gt;&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr class="TableRowColor" bgcolor="white"&gt; &lt;td&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html#getFont%28%29"&gt;getFont&lt;/a&gt;, &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html#postEvent%28java.awt.Event%29"&gt;postEvent&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;   &lt;p&gt;  &lt;!-- ============ FIELD DETAIL =========== --&gt;  &lt;a name="field_detail"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;/p&gt;&lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="1" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Field Detail&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="DEFAULT_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; DEFAULT_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;DEFAULT_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.DEFAULT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.DEFAULT_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="CROSSHAIR_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; CROSSHAIR_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;CROSSHAIR_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.CROSSHAIR_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.CROSSHAIR_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="TEXT_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; TEXT_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;TEXT_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.TEXT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.TEXT_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="WAIT_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; WAIT_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;WAIT_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.WAIT_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.WAIT_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="SW_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; SW_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;SW_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.SW_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.SW_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="SE_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; SE_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;SE_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.SE_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.SE_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="NW_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; NW_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;NW_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.NW_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.NW_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="NE_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; NE_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;NE_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.NE_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.NE_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="N_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; N_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;N_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.N_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.N_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="S_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; S_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;S_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.S_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.S_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="W_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; W_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;W_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.W_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.W_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="E_RESIZE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; E_RESIZE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;E_RESIZE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.E_RESIZE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.E_RESIZE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="HAND_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; HAND_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;HAND_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.HAND_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.HAND_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="MOVE_CURSOR"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; MOVE_CURSOR&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public static final int &lt;b&gt;MOVE_CURSOR&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;replaced by &lt;code&gt;Cursor.MOVE_CURSOR&lt;/code&gt;.&lt;/i&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.MOVE_CURSOR"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="NORMAL"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; NORMAL&lt;/h3&gt; &lt;pre&gt;public static final int &lt;b&gt;NORMAL&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Frame is in the "normal" state.  This symbolic constant names a  frame state with all state bits cleared. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.NORMAL"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="ICONIFIED"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; ICONIFIED&lt;/h3&gt; &lt;pre&gt;public static final int &lt;b&gt;ICONIFIED&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;This state bit indicates that frame is iconified. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.ICONIFIED"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="MAXIMIZED_HORIZ"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; MAXIMIZED_HORIZ&lt;/h3&gt; &lt;pre&gt;public static final int &lt;b&gt;MAXIMIZED_HORIZ&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;This state bit indicates that frame is maximized in the  horizontal direction. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.MAXIMIZED_HORIZ"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="MAXIMIZED_VERT"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; MAXIMIZED_VERT&lt;/h3&gt; &lt;pre&gt;public static final int &lt;b&gt;MAXIMIZED_VERT&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;This state bit indicates that frame is maximized in the  vertical direction. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.MAXIMIZED_VERT"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="MAXIMIZED_BOTH"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; MAXIMIZED_BOTH&lt;/h3&gt; &lt;pre&gt;public static final int &lt;b&gt;MAXIMIZED_BOTH&lt;/b&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;This state bit mask indicates that frame is fully maximized  (that is both horizontally and vertically).  It is just a  convenience alias for  &lt;code&gt;MAXIMIZED_VERT | MAXIMIZED_HORIZ&lt;/code&gt;.   &lt;p&gt;Note that the correct test for frame being fully maximized is  &lt;/p&gt;&lt;pre&gt;     (state &amp;amp; Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;To test is frame is maximized in &lt;em&gt;some&lt;/em&gt; direction use  &lt;/p&gt;&lt;pre&gt;     (state &amp;amp; Frame.MAXIMIZED_BOTH) != 0&lt;br /&gt;&lt;/pre&gt; &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/constant-values.html#java.awt.Frame.MAXIMIZED_BOTH"&gt;Constant Field Values&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt;  &lt;!-- ========= CONSTRUCTOR DETAIL ======== --&gt;  &lt;a name="constructor_detail"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="1" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Constructor Detail&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="Frame()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; Frame&lt;/h3&gt; &lt;pre&gt;public &lt;b&gt;Frame&lt;/b&gt;()&lt;br /&gt;     throws &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/HeadlessException.html" title="class in java.awt"&gt;HeadlessException&lt;/a&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Constructs a new instance of &lt;code&gt;Frame&lt;/code&gt; that is   initially invisible.  The title of the &lt;code&gt;Frame&lt;/code&gt;  is empty. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/HeadlessException.html" title="class in java.awt"&gt;HeadlessException&lt;/a&gt;&lt;/code&gt; - when GraphicsEnvironment.isHeadless()  returns true&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsEnvironment.html#isHeadless%28%29"&gt;&lt;code&gt;GraphicsEnvironment.isHeadless()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setSize%28int,%20int%29"&gt;&lt;code&gt;Component.setSize(int, int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setVisible%28boolean%29"&gt;&lt;code&gt;Component.setVisible(boolean)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="Frame(java.awt.GraphicsConfiguration)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; Frame&lt;/h3&gt; &lt;pre&gt;public &lt;b&gt;Frame&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html" title="class in java.awt"&gt;GraphicsConfiguration&lt;/a&gt; gc)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Create a &lt;code&gt;Frame&lt;/code&gt; with the specified   &lt;code&gt;GraphicsConfiguration&lt;/code&gt; of  a screen device. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;gc&lt;/code&gt; - the &lt;code&gt;GraphicsConfiguration&lt;/code&gt;   of the target screen device. If &lt;code&gt;gc&lt;/code&gt;   is &lt;code&gt;null&lt;/code&gt;, the system default   &lt;code&gt;GraphicsConfiguration&lt;/code&gt; is assumed. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/IllegalArgumentException.html" title="class in java.lang"&gt;IllegalArgumentException&lt;/a&gt;&lt;/code&gt; - if   &lt;code&gt;gc&lt;/code&gt; is not from a screen device.  This exception is always thrown  when GraphicsEnvironment.isHeadless() returns true&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.3&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsEnvironment.html#isHeadless%28%29"&gt;&lt;code&gt;GraphicsEnvironment.isHeadless()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="Frame(java.lang.String)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; Frame&lt;/h3&gt; &lt;pre&gt;public &lt;b&gt;Frame&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title)&lt;br /&gt;     throws &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/HeadlessException.html" title="class in java.awt"&gt;HeadlessException&lt;/a&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Constructs a new, initially invisible &lt;code&gt;Frame&lt;/code&gt; object   with the specified title. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;title&lt;/code&gt; - the title to be displayed in the frame's border.               A &lt;code&gt;null&lt;/code&gt; value               is treated as an empty string, "". &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/HeadlessException.html" title="class in java.awt"&gt;HeadlessException&lt;/a&gt;&lt;/code&gt; - when GraphicsEnvironment.isHeadless()  returns true&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsEnvironment.html#isHeadless%28%29"&gt;&lt;code&gt;GraphicsEnvironment.isHeadless()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setSize%28int,%20int%29"&gt;&lt;code&gt;Component.setSize(int, int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setVisible%28boolean%29"&gt;&lt;code&gt;Component.setVisible(boolean)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html#getBounds%28%29"&gt;&lt;code&gt;GraphicsConfiguration.getBounds()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="Frame(java.lang.String, java.awt.GraphicsConfiguration)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; Frame&lt;/h3&gt; &lt;pre&gt;public &lt;b&gt;Frame&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title,&lt;br /&gt;            &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html" title="class in java.awt"&gt;GraphicsConfiguration&lt;/a&gt; gc)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Constructs a new, initially invisible &lt;code&gt;Frame&lt;/code&gt; object   with the specified title and a   &lt;code&gt;GraphicsConfiguration&lt;/code&gt;. &lt;p&gt; &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;title&lt;/code&gt; - the title to be displayed in the frame's border.               A &lt;code&gt;null&lt;/code&gt; value               is treated as an empty string, "".&lt;/dd&gt;&lt;dd&gt;&lt;code&gt;gc&lt;/code&gt; - the &lt;code&gt;GraphicsConfiguration&lt;/code&gt;   of the target screen device.  If &lt;code&gt;gc&lt;/code&gt; is   &lt;code&gt;null&lt;/code&gt;, the system default   &lt;code&gt;GraphicsConfiguration&lt;/code&gt; is assumed. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/IllegalArgumentException.html" title="class in java.lang"&gt;IllegalArgumentException&lt;/a&gt;&lt;/code&gt; - if &lt;code&gt;gc&lt;/code&gt;   is not from a screen device.  This exception is always thrown  when GraphicsEnvironment.isHeadless() returns true&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsEnvironment.html#isHeadless%28%29"&gt;&lt;code&gt;GraphicsEnvironment.isHeadless()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setSize%28int,%20int%29"&gt;&lt;code&gt;Component.setSize(int, int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#setVisible%28boolean%29"&gt;&lt;code&gt;Component.setVisible(boolean)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/GraphicsConfiguration.html#getBounds%28%29"&gt;&lt;code&gt;GraphicsConfiguration.getBounds()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt;  &lt;!-- ============ METHOD DETAIL ========== --&gt;  &lt;a name="method_detail"&gt;&lt;!-- --&gt;&lt;/a&gt; &lt;table summary="" width="100%" border="1" cellpadding="3" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr class="TableHeadingColor" bg style="color:#ccccff;"&gt; &lt;th colspan="1" align="left"&gt;&lt;span style="font-size:+2;"&gt; &lt;b&gt;Method Detail&lt;/b&gt;&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="finalize()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; finalize&lt;/h3&gt; &lt;pre&gt;protected void &lt;b&gt;finalize&lt;/b&gt;()&lt;br /&gt;                throws &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Throwable.html" title="class in java.lang"&gt;Throwable&lt;/a&gt;&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Disposes of the input methods and context, and removes   this Frame from the AppContext.  Subclasses that override   this method should call super.finalize(). &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#finalize%28%29"&gt;finalize&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Throwable.html" title="class in java.lang"&gt;Throwable&lt;/a&gt;&lt;/code&gt; - the &lt;code&gt;Exception&lt;/code&gt; raised by this method&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="addNotify()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; addNotify&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;addNotify&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Makes this Frame displayable by connecting it to  a native screen resource.  Making a frame displayable will  cause any of its children to be made displayable.  This method is called internally by the toolkit and should  not be called directly by programs. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#addNotify%28%29"&gt;addNotify&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDisplayable%28%29"&gt;&lt;code&gt;Component.isDisplayable()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#removeNotify%28%29"&gt;&lt;code&gt;removeNotify()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getTitle()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getTitle&lt;/h3&gt; &lt;pre&gt;public &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; &lt;b&gt;getTitle&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the title of the frame.  The title is displayed in the  frame's border. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;the title of this frame, or an empty string ("")                 if this frame doesn't have a title.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setTitle%28java.lang.String%29"&gt;&lt;code&gt;setTitle(String)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setTitle(java.lang.String)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setTitle&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setTitle&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; title)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the title for this frame to the specified string. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;title&lt;/code&gt; - the title to be displayed in the frame's border.               A &lt;code&gt;null&lt;/code&gt; value               is treated as an empty string, "".&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getTitle%28%29"&gt;&lt;code&gt;getTitle()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getIconImage()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getIconImage&lt;/h3&gt; &lt;pre&gt;public &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Image.html" title="class in java.awt"&gt;Image&lt;/a&gt; &lt;b&gt;getIconImage&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the image to be displayed in the minimized icon  for this frame. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;the icon image for this frame, or &lt;code&gt;null&lt;/code&gt;                      if this frame doesn't have an icon image.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setIconImage%28java.awt.Image%29"&gt;&lt;code&gt;setIconImage(Image)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setIconImage(java.awt.Image)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setIconImage&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setIconImage&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Image.html" title="class in java.awt"&gt;Image&lt;/a&gt; image)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the image to be displayed in the minimized icon for this frame.   Not all platforms support the concept of minimizing a window. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;image&lt;/code&gt; - the icon image to be displayed.             If this parameter is &lt;code&gt;null&lt;/code&gt; then the             icon image is set to the default image, which may vary             with platform.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getIconImage%28%29"&gt;&lt;code&gt;getIconImage()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getMenuBar()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getMenuBar&lt;/h3&gt; &lt;pre&gt;public &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuBar.html" title="class in java.awt"&gt;MenuBar&lt;/a&gt; &lt;b&gt;getMenuBar&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the menu bar for this frame. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;the menu bar for this frame, or &lt;code&gt;null&lt;/code&gt;                     if this frame doesn't have a menu bar.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setMenuBar%28java.awt.MenuBar%29"&gt;&lt;code&gt;setMenuBar(MenuBar)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setMenuBar(java.awt.MenuBar)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setMenuBar&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setMenuBar&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuBar.html" title="class in java.awt"&gt;MenuBar&lt;/a&gt; mb)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the menu bar for this frame to the specified menu bar. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;mb&lt;/code&gt; - the menu bar being set.             If this parameter is &lt;code&gt;null&lt;/code&gt; then any             existing menu bar on this frame is removed.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getMenuBar%28%29"&gt;&lt;code&gt;getMenuBar()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="isResizable()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; isResizable&lt;/h3&gt; &lt;pre&gt;public boolean &lt;b&gt;isResizable&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Indicates whether this frame is resizable by the user.    By default, all frames are initially resizable. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;true&lt;/code&gt; if the user can resize this frame;                          &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setResizable%28boolean%29"&gt;&lt;code&gt;setResizable(boolean)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setResizable(boolean)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setResizable&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setResizable&lt;/b&gt;(boolean resizable)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets whether this frame is resizable by the user. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;resizable&lt;/code&gt; - &lt;code&gt;true&lt;/code&gt; if this frame is resizable;                         &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#isResizable%28%29"&gt;&lt;code&gt;isResizable()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setState(int)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setState&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setState&lt;/b&gt;(int state)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the state of this frame (obsolete).  &lt;p&gt;  In older versions of JDK a frame state could only be NORMAL or  ICONIFIED.  Since JDK 1.4 set of supported frame states is  expanded and frame state is represented as a bitwise mask.  &lt;/p&gt;&lt;p&gt;  For compatibility with old programs this method still accepts  &lt;code&gt;Frame.NORMAL&lt;/code&gt; and &lt;code&gt;Frame.ICONIFIED&lt;/code&gt; but  it only changes the iconic state of the frame, other aspects of  frame state are not affected by this method. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;state&lt;/code&gt; - either &lt;code&gt;Frame.NORMAL&lt;/code&gt; or      &lt;code&gt;Frame.ICONIFIED&lt;/code&gt;.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getState%28%29"&gt;&lt;code&gt;getState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setExtendedState(int)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setExtendedState&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setExtendedState&lt;/b&gt;(int state)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the state of this frame. The state is  represented as a bitwise mask.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;NORMAL&lt;/code&gt; &lt;br /&gt;Indicates that no state bits are set.  &lt;/li&gt;&lt;li&gt;&lt;code&gt;ICONIFIED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_HORIZ&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_VERT&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_BOTH&lt;/code&gt; &lt;br /&gt;Concatenates &lt;code&gt;MAXIMIZED_HORIZ&lt;/code&gt;  and &lt;code&gt;MAXIMIZED_VERT&lt;/code&gt;.  &lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;Note that if the state is not supported on a  given platform, nothing will happen. The application  may determine if a specific state is available via  the &lt;code&gt;java.awt.Toolkit#isFrameStateSupported(int state)&lt;/code&gt;  method. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;state&lt;/code&gt; - a bitwise mask of frame state constants&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Toolkit.html#isFrameStateSupported%28int%29"&gt;&lt;code&gt;Toolkit.isFrameStateSupported(int)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getState()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getState&lt;/h3&gt; &lt;pre&gt;public int &lt;b&gt;getState&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the state of this frame (obsolete).  &lt;p&gt;  In older versions of JDK a frame state could only be NORMAL or  ICONIFIED.  Since JDK 1.4 set of supported frame states is  expanded and frame state is represented as a bitwise mask.  &lt;/p&gt;&lt;p&gt;  For compatibility with old programs this method still returns  &lt;code&gt;Frame.NORMAL&lt;/code&gt; and &lt;code&gt;Frame.ICONIFIED&lt;/code&gt; but  it only reports the iconic state of the frame, other aspects of  frame state are not reported by this method. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;Frame.NORMAL&lt;/code&gt; or &lt;code&gt;Frame.ICONIFIED&lt;/code&gt;.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setState%28int%29"&gt;&lt;code&gt;setState(int)&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getExtendedState%28%29"&gt;&lt;code&gt;getExtendedState()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getExtendedState()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getExtendedState&lt;/h3&gt; &lt;pre&gt;public int &lt;b&gt;getExtendedState&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the state of this frame. The state is  represented as a bitwise mask.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;NORMAL&lt;/code&gt; &lt;br /&gt;Indicates that no state bits are set.  &lt;/li&gt;&lt;li&gt;&lt;code&gt;ICONIFIED&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_HORIZ&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_VERT&lt;/code&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;MAXIMIZED_BOTH&lt;/code&gt; &lt;br /&gt;Concatenates &lt;code&gt;MAXIMIZED_HORIZ&lt;/code&gt;  and &lt;code&gt;MAXIMIZED_VERT&lt;/code&gt;.  &lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;a bitwise mask of frame state constants&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setExtendedState%28int%29"&gt;&lt;code&gt;setExtendedState(int)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setMaximizedBounds(java.awt.Rectangle)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setMaximizedBounds&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setMaximizedBounds&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Rectangle.html" title="class in java.awt"&gt;Rectangle&lt;/a&gt; bounds)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Sets the maximized bounds for this frame.  &lt;p&gt;  When a frame is in maximized state the system supplies some  defaults bounds.  This method allows some or all of those  system supplied values to be overridden.  &lt;/p&gt;&lt;p&gt;  If &lt;code&gt;bounds&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, accept bounds  supplied by the system.  If non-&lt;code&gt;null&lt;/code&gt; you can  override some of the system supplied values while accepting  others by setting those fields you want to accept from system  to &lt;code&gt;Integer.MAX_VALUE&lt;/code&gt;.  &lt;/p&gt;&lt;p&gt;  On some systems only the size portion of the bounds is taken  into account. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;bounds&lt;/code&gt; - bounds for the maximized state&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#getMaximizedBounds%28%29"&gt;&lt;code&gt;getMaximizedBounds()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getMaximizedBounds()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getMaximizedBounds&lt;/h3&gt; &lt;pre&gt;public &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Rectangle.html" title="class in java.awt"&gt;Rectangle&lt;/a&gt; &lt;b&gt;getMaximizedBounds&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets maximized bounds for this frame.  Some fields may contain &lt;code&gt;Integer.MAX_VALUE&lt;/code&gt; to indicate  that system supplied values for this field must be used. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;maximized bounds for this frame;  may be &lt;code&gt;null&lt;/code&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setMaximizedBounds%28java.awt.Rectangle%29"&gt;&lt;code&gt;setMaximizedBounds(Rectangle)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setUndecorated(boolean)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setUndecorated&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;setUndecorated&lt;/b&gt;(boolean undecorated)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Disables or enables decorations for this frame.  This method can only be called while the frame is not displayable. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;undecorated&lt;/code&gt; - &lt;code&gt;true&lt;/code&gt; if no frame decorations are           to be enabled;          &lt;code&gt;false&lt;/code&gt; if frame decorations are to be enabled. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Throws:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;code&gt;IllegalComponentStateException&lt;/code&gt;&lt;/code&gt; - if the frame          is displayable.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#isUndecorated%28%29"&gt;&lt;code&gt;isUndecorated()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDisplayable%28%29"&gt;&lt;code&gt;Component.isDisplayable()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/swing/JFrame.html#setDefaultLookAndFeelDecorated%28boolean%29"&gt;&lt;code&gt;JFrame.setDefaultLookAndFeelDecorated(boolean)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="isUndecorated()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; isUndecorated&lt;/h3&gt; &lt;pre&gt;public boolean &lt;b&gt;isUndecorated&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Indicates whether this frame is undecorated.    By default, all frames are initially decorated. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;true&lt;/code&gt; if frame is undecorated;                          &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.4&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#setUndecorated%28boolean%29"&gt;&lt;code&gt;setUndecorated(boolean)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="remove(java.awt.MenuComponent)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; remove&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;remove&lt;/b&gt;(&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuComponent.html" title="class in java.awt"&gt;MenuComponent&lt;/a&gt; m)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Removes the specified menu bar from this frame. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Specified by:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html#remove%28java.awt.MenuComponent%29"&gt;remove&lt;/a&gt;&lt;/code&gt; in interface &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/MenuContainer.html" title="interface in java.awt"&gt;MenuContainer&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#remove%28java.awt.MenuComponent%29"&gt;remove&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html" title="class in java.awt"&gt;Component&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;m&lt;/code&gt; - the menu component to remove.            If &lt;code&gt;m&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, then             no action is taken&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#add%28java.awt.PopupMenu%29"&gt;&lt;code&gt;Component.add(PopupMenu)&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="removeNotify()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; removeNotify&lt;/h3&gt; &lt;pre&gt;public void &lt;b&gt;removeNotify&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Makes this Frame undisplayable by removing its connection  to its native screen resource. Making a Frame undisplayable  will cause any of its children to be made undisplayable.   This method is called by the toolkit internally and should  not be called directly by programs. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#removeNotify%28%29"&gt;removeNotify&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html" title="class in java.awt"&gt;Container&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Component.html#isDisplayable%28%29"&gt;&lt;code&gt;Component.isDisplayable()&lt;/code&gt;&lt;/a&gt;,  &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html#addNotify%28%29"&gt;&lt;code&gt;addNotify()&lt;/code&gt;&lt;/a&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="paramString()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; paramString&lt;/h3&gt; &lt;pre&gt;protected &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/String.html" title="class in java.lang"&gt;String&lt;/a&gt; &lt;b&gt;paramString&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Returns a string representing the state of this &lt;code&gt;Frame&lt;/code&gt;.  This method is intended to be used only for debugging purposes, and the   content and format of the returned string may vary between   implementations. The returned string may be empty but may not be   &lt;code&gt;null&lt;/code&gt;. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html#paramString%28%29"&gt;paramString&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Container.html" title="class in java.awt"&gt;Container&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;the parameter string of this frame&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="setCursor(int)"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; setCursor&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public void &lt;b&gt;setCursor&lt;/b&gt;(int cursorType)&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;As of JDK version 1.1,  replaced by &lt;code&gt;Component.setCursor(Cursor)&lt;/code&gt;.&lt;/i&gt; &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getCursorType()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getCursorType&lt;/h3&gt; &lt;pre&gt;&lt;span style="font-size:-1;"&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/lang/Deprecated.html" title="annotation in java.lang"&gt;@Deprecated&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;public int &lt;b&gt;getCursorType&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;&lt;b&gt;Deprecated.&lt;/b&gt; &lt;i&gt;As of JDK version 1.1,  replaced by &lt;code&gt;Component.getCursor()&lt;/code&gt;.&lt;/i&gt; &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getFrames()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getFrames&lt;/h3&gt; &lt;pre&gt;public static &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Frame.html" title="class in java.awt"&gt;Frame&lt;/a&gt;[] &lt;b&gt;getFrames&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Returns an array containing all Frames created by the application.  If called from an applet, the array will only include the Frames  accessible by that applet. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Since:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;1.2&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt; &lt;hr /&gt;  &lt;a name="getAccessibleContext()"&gt;&lt;!-- --&gt;&lt;/a&gt;&lt;h3&gt; getAccessibleContext&lt;/h3&gt; &lt;pre&gt;public &lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/accessibility/AccessibleContext.html" title="class in javax.accessibility"&gt;AccessibleContext&lt;/a&gt; &lt;b&gt;getAccessibleContext&lt;/b&gt;()&lt;/pre&gt; &lt;dl&gt;&lt;dd&gt;Gets the AccessibleContext associated with this Frame.   For frames, the AccessibleContext takes the form of an   AccessibleAWTFrame.   A new AccessibleAWTFrame instance is created if necessary. &lt;p&gt; &lt;/p&gt;&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Specified by:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/accessibility/Accessible.html#getAccessibleContext%28%29"&gt;getAccessibleContext&lt;/a&gt;&lt;/code&gt; in interface &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/javax/accessibility/Accessible.html" title="interface in javax.accessibility"&gt;Accessible&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Overrides:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html#getAccessibleContext%28%29"&gt;getAccessibleContext&lt;/a&gt;&lt;/code&gt; in class &lt;code&gt;&lt;a href="file:///E:/JAVA/JAVA/java1.5%20API/J2SE%201.5%20API/api/java/awt/Window.html" title="class in java.awt"&gt;Window&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;an AccessibleAWTFrame that serves as the           AccessibleContext of this Frame&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-1535749794638051362?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/1535749794638051362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=1535749794638051362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1535749794638051362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1535749794638051362'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/11/api-of-frame-class.html' title='API of Frame Class'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-92773475923816471</id><published>2008-09-08T11:36:00.001-07:00</published><updated>2008-09-08T11:40:07.286-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='session pattern in java'/><title type='text'>Session Pattern Examples in Java</title><content type='html'>&lt;span style="color: rgb(204, 0, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;Session Pattern in Java&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;//[C] 2002 Sun Microsystems, Inc.----&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.Serializable;&lt;br /&gt;import java.net.MalformedURLException;&lt;br /&gt;import java.rmi.Naming;&lt;br /&gt;import java.rmi.NotBoundException;&lt;br /&gt;import java.rmi.Remote;&lt;br /&gt;import java.rmi.RemoteException;&lt;br /&gt;import java.rmi.server.UnicastRemoteObject;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;&lt;br /&gt;public class RunSessionPattern {&lt;br /&gt;  public static void main(String[] arguments) {&lt;br /&gt;    System.out.println("Example for the Session pattern");&lt;br /&gt;    System.out&lt;br /&gt;        .println("This demonstration will show how a Session can be used");&lt;br /&gt;    System.out&lt;br /&gt;        .println(" to organize a series of actions between a client and");&lt;br /&gt;    System.out.println(" server.");&lt;br /&gt;    System.out&lt;br /&gt;        .println("In this case, clients will use sessions to coordinate");&lt;br /&gt;    System.out.println(" edits of Contact addresses.");&lt;br /&gt;    System.out.println();&lt;br /&gt;&lt;br /&gt;    System.out.println("Running the RMI compiler (rmic)");&lt;br /&gt;    System.out.println();&lt;br /&gt;    try {&lt;br /&gt;      Process p1 = Runtime.getRuntime().exec("rmic SessionServerImpl");&lt;br /&gt;      p1.waitFor();&lt;br /&gt;    } catch (IOException exc) {&lt;br /&gt;      System.err&lt;br /&gt;          .println("Unable to run rmic utility. Exiting application.");&lt;br /&gt;      System.exit(1);&lt;br /&gt;    } catch (InterruptedException exc) {&lt;br /&gt;      System.err&lt;br /&gt;          .println("Threading problems encountered while using the rmic utility.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    System.out.println("Starting the rmiregistry");&lt;br /&gt;    System.out.println();&lt;br /&gt;    Process rmiProcess = null;&lt;br /&gt;    try {&lt;br /&gt;      rmiProcess = Runtime.getRuntime().exec("rmiregistry");&lt;br /&gt;      Thread.sleep(15000);&lt;br /&gt;    } catch (IOException exc) {&lt;br /&gt;      System.err&lt;br /&gt;          .println("Unable to start the rmiregistry. Exiting application.");&lt;br /&gt;      System.exit(1);&lt;br /&gt;    } catch (InterruptedException exc) {&lt;br /&gt;      System.err&lt;br /&gt;          .println("Threading problems encountered when starting the rmiregistry.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    System.out&lt;br /&gt;        .println("Creating the SessionServer and two SessionClient objects");&lt;br /&gt;    System.out.println();&lt;br /&gt;    SessionServer serverObject = new SessionServerImpl();&lt;br /&gt;    SessionClient clientOne = new SessionClient();&lt;br /&gt;    SessionClient clientTwo = new SessionClient();&lt;br /&gt;&lt;br /&gt;    System.out.println("Creating sample Contacts and Addresses");&lt;br /&gt;    System.out.println();&lt;br /&gt;    Contact firstContact = new ContactImpl("First", "Contact", "primo",&lt;br /&gt;        "OOI", null);&lt;br /&gt;    Contact secondContact = new ContactImpl("Second", "Contact", "secondo",&lt;br /&gt;        "OOI", null);&lt;br /&gt;    Address workAddress = new AddressImpl("Work address", "5440 Division",&lt;br /&gt;        "Fargo", "ND", "54321");&lt;br /&gt;    Address homeAddress = new AddressImpl("Home address", "40 Planar Way",&lt;br /&gt;        "Paris", "TX", "84301");&lt;br /&gt;&lt;br /&gt;    System.out&lt;br /&gt;        .println("Adding a contact. Both clients will attempt to edit");&lt;br /&gt;    System.out&lt;br /&gt;        .println(" the same contact at first, which will result in a");&lt;br /&gt;    System.out.println(" SessionException.");&lt;br /&gt;    try {&lt;br /&gt;      clientOne.addContact(firstContact);&lt;br /&gt;      clientTwo.addContact(firstContact);&lt;br /&gt;    } catch (SessionException exc) {&lt;br /&gt;      System.err.println("Exception encountered:");&lt;br /&gt;      System.err.println(exc);&lt;br /&gt;    }&lt;br /&gt;    try {&lt;br /&gt;      System.out&lt;br /&gt;          .println("Adding a different contact to the second client");&lt;br /&gt;      clientTwo.addContact(secondContact);&lt;br /&gt;      System.out&lt;br /&gt;          .println("Adding addresses to the first and second clients");&lt;br /&gt;      clientTwo.addAddress(workAddress);&lt;br /&gt;      clientOne.addAddress(homeAddress);&lt;br /&gt;      clientTwo.addAddress(workAddress);&lt;br /&gt;      clientTwo.addAddress(homeAddress);&lt;br /&gt;      System.out.println("Removing address from a client");&lt;br /&gt;      clientTwo.removeAddress(homeAddress);&lt;br /&gt;      System.out.println("Finalizing the edits to the contacts");&lt;br /&gt;      clientOne.commitChanges();&lt;br /&gt;      clientTwo.commitChanges();&lt;br /&gt;      System.out.println("Changes finalized");&lt;br /&gt;      clientTwo.addContact(firstContact);&lt;br /&gt;    } catch (SessionException exc) {&lt;br /&gt;      System.err.println("Exception encountered:");&lt;br /&gt;      System.err.println(exc);&lt;br /&gt;    }&lt;br /&gt;    System.out.println("The following lines will show the state");&lt;br /&gt;    System.out.println(" of the server-side delegate, which in this");&lt;br /&gt;    System.out.println(" example represents a persistent data store.");&lt;br /&gt;    System.out.println();&lt;br /&gt;    System.out.println("Contact list:");&lt;br /&gt;    System.out.println(SessionServerDelegate.getContacts());&lt;br /&gt;    System.out.println("Address list:");&lt;br /&gt;    System.out.println(SessionServerDelegate.getAddresses());&lt;br /&gt;    System.out.println("Edit contacts:");&lt;br /&gt;    System.out.println(SessionServerDelegate.getEditContacts());&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;--------------------------------------------------------------------------------&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;interface Address extends Serializable {&lt;br /&gt;  public static final String EOL_STRING = System&lt;br /&gt;      .getProperty("line.separator");&lt;br /&gt;&lt;br /&gt;  public static final String SPACE = " ";&lt;br /&gt;&lt;br /&gt;  public static final String COMMA = ",";&lt;br /&gt;&lt;br /&gt;  public String getType();&lt;br /&gt;&lt;br /&gt;  public String getDescription();&lt;br /&gt;&lt;br /&gt;  public String getStreet();&lt;br /&gt;&lt;br /&gt;  public String getCity();&lt;br /&gt;&lt;br /&gt;  public String getState();&lt;br /&gt;&lt;br /&gt;  public String getZipCode();&lt;br /&gt;&lt;br /&gt;  public void setType(String newType);&lt;br /&gt;&lt;br /&gt;  public void setDescription(String newDescription);&lt;br /&gt;&lt;br /&gt;  public void setStreet(String newStreet);&lt;br /&gt;&lt;br /&gt;  public void setCity(String newCity);&lt;br /&gt;&lt;br /&gt;  public void setState(String newState);&lt;br /&gt;&lt;br /&gt;  public void setZipCode(String newZip);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;--------------------------------------------------------------------------------&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;class AddressImpl implements Address {&lt;br /&gt;  private String type;&lt;br /&gt;&lt;br /&gt;  private String description;&lt;br /&gt;&lt;br /&gt;  private String street;&lt;br /&gt;&lt;br /&gt;  private String city;&lt;br /&gt;&lt;br /&gt;  private String state;&lt;br /&gt;&lt;br /&gt;  private String zipCode;&lt;br /&gt;&lt;br /&gt;  public AddressImpl() {&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public AddressImpl(String newDescription, String newStreet, String newCity,&lt;br /&gt;      String newState, String newZipCode) {&lt;br /&gt;    description = newDescription;&lt;br /&gt;    street = newStreet;&lt;br /&gt;    city = newCity;&lt;br /&gt;    state = newState;&lt;br /&gt;    zipCode = newZipCode;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getType() {&lt;br /&gt;    return type;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getDescription() {&lt;br /&gt;    return description;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getStreet() {&lt;br /&gt;    return street;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getCity() {&lt;br /&gt;    return city;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getState() {&lt;br /&gt;    return state;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getZipCode() {&lt;br /&gt;    return zipCode;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setType(String newType) {&lt;br /&gt;    type = newType;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setDescription(String newDescription) {&lt;br /&gt;    description = newDescription;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setStreet(String newStreet) {&lt;br /&gt;    street = newStreet;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setCity(String newCity) {&lt;br /&gt;    city = newCity;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setState(String newState) {&lt;br /&gt;    state = newState;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setZipCode(String newZip) {&lt;br /&gt;    zipCode = newZip;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public boolean equals(Object o) {&lt;br /&gt;    if (!(o instanceof AddressImpl)) {&lt;br /&gt;      return false;&lt;br /&gt;    } else {&lt;br /&gt;      AddressImpl address = (AddressImpl) o;&lt;br /&gt;      if (street.equals(address.street) &amp;amp;&amp;amp; city.equals(address.city)&lt;br /&gt;          &amp;amp;&amp;amp; state.equals(address.state)&lt;br /&gt;          &amp;amp;&amp;amp; zipCode.equals(address.zipCode)) {&lt;br /&gt;        return true;&lt;br /&gt;      }&lt;br /&gt;      return false;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String toString() {&lt;br /&gt;    return street + EOL_STRING + city + COMMA + SPACE + state + SPACE&lt;br /&gt;        + zipCode + EOL_STRING;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;------------------------------------------------------------------------------&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;class SessionServerImpl implements SessionServer {&lt;br /&gt;  private static final String SESSION_SERVER_SERVICE_NAME = "sessionServer";&lt;br /&gt;&lt;br /&gt;  public SessionServerImpl() {&lt;br /&gt;    try {&lt;br /&gt;      UnicastRemoteObject.exportObject(this);&lt;br /&gt;      Naming.rebind(SESSION_SERVER_SERVICE_NAME, this);&lt;br /&gt;    } catch (Exception exc) {&lt;br /&gt;      System.err&lt;br /&gt;          .println("Error using RMI to register the SessionServerImpl "&lt;br /&gt;              + exc);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public long addContact(Contact contact, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    return SessionServerDelegate.addContact(contact, sessionID);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public long addAddress(Address address, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    return SessionServerDelegate.addAddress(address, sessionID);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public long removeAddress(Address address, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    return SessionServerDelegate.removeAddress(address, sessionID);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public long finalizeContact(long sessionID) throws SessionException {&lt;br /&gt;    return SessionServerDelegate.finalizeContact(sessionID);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;interface SessionServer extends Remote {&lt;br /&gt;  public long addContact(Contact contact, long sessionID)&lt;br /&gt;      throws RemoteException, SessionException;&lt;br /&gt;&lt;br /&gt;  public long addAddress(Address address, long sessionID)&lt;br /&gt;      throws RemoteException, SessionException;&lt;br /&gt;&lt;br /&gt;  public long removeAddress(Address address, long sessionID)&lt;br /&gt;      throws RemoteException, SessionException;&lt;br /&gt;&lt;br /&gt;  public long finalizeContact(long sessionID) throws RemoteException,&lt;br /&gt;      SessionException;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class SessionServerDelegate {&lt;br /&gt;  private static final long NO_SESSION_ID = 0;&lt;br /&gt;&lt;br /&gt;  private static long nextSessionID = 1;&lt;br /&gt;&lt;br /&gt;  private static ArrayList contacts = new ArrayList();&lt;br /&gt;&lt;br /&gt;  private static ArrayList addresses = new ArrayList();&lt;br /&gt;&lt;br /&gt;  private static HashMap editContacts = new HashMap();&lt;br /&gt;&lt;br /&gt;  public static long addContact(Contact contact, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    if (sessionID &lt;= NO_SESSION_ID) {&lt;br /&gt;      sessionID = getSessionID();&lt;br /&gt;    }&lt;br /&gt;    if (contacts.indexOf(contact) != -1) {&lt;br /&gt;      if (!editContacts.containsValue(contact)) {&lt;br /&gt;        editContacts.put(new Long(sessionID), contact);&lt;br /&gt;      } else {&lt;br /&gt;        throw new SessionException(&lt;br /&gt;            "This contact is currently being edited by another user.",&lt;br /&gt;            SessionException.CONTACT_BEING_EDITED);&lt;br /&gt;      }&lt;br /&gt;    } else {&lt;br /&gt;      contacts.add(contact);&lt;br /&gt;      editContacts.put(new Long(sessionID), contact);&lt;br /&gt;    }&lt;br /&gt;    return sessionID;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static long addAddress(Address address, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    if (sessionID &lt;= NO_SESSION_ID) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "A valid session ID is required to add an address",&lt;br /&gt;          SessionException.SESSION_ID_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    Contact contact = (Contact) editContacts.get(new Long(sessionID));&lt;br /&gt;    if (contact == null) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "You must select a contact before adding an address",&lt;br /&gt;          SessionException.CONTACT_SELECT_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    if (addresses.indexOf(address) == -1) {&lt;br /&gt;      addresses.add(address);&lt;br /&gt;    }&lt;br /&gt;    contact.addAddress(address);&lt;br /&gt;    return sessionID;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static long removeAddress(Address address, long sessionID)&lt;br /&gt;      throws SessionException {&lt;br /&gt;    if (sessionID &lt;= NO_SESSION_ID) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "A valid session ID is required to remove an address",&lt;br /&gt;          SessionException.SESSION_ID_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    Contact contact = (Contact) editContacts.get(new Long(sessionID));&lt;br /&gt;    if (contact == null) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "You must select a contact before removing an address",&lt;br /&gt;          SessionException.CONTACT_SELECT_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    if (addresses.indexOf(address) == -1) {&lt;br /&gt;      throw new SessionException("There is no record of this address",&lt;br /&gt;          SessionException.ADDRESS_DOES_NOT_EXIST);&lt;br /&gt;    }&lt;br /&gt;    contact.removeAddress(address);&lt;br /&gt;    return sessionID;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static long finalizeContact(long sessionID) throws SessionException {&lt;br /&gt;    if (sessionID &lt;= NO_SESSION_ID) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "A valid session ID is required to finalize a contact",&lt;br /&gt;          SessionException.SESSION_ID_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    Contact contact = (Contact) editContacts.get(new Long(sessionID));&lt;br /&gt;    if (contact == null) {&lt;br /&gt;      throw new SessionException(&lt;br /&gt;          "You must select and edit a contact before committing changes",&lt;br /&gt;          SessionException.CONTACT_SELECT_REQUIRED);&lt;br /&gt;    }&lt;br /&gt;    editContacts.remove(new Long(sessionID));&lt;br /&gt;    return NO_SESSION_ID;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private static long getSessionID() {&lt;br /&gt;    return nextSessionID++;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static ArrayList getContacts() {&lt;br /&gt;    return contacts;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static ArrayList getAddresses() {&lt;br /&gt;    return addresses;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static ArrayList getEditContacts() {&lt;br /&gt;    return new ArrayList(editContacts.values());&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;interface Contact extends Serializable {&lt;br /&gt;  public static final String SPACE = " ";&lt;br /&gt;&lt;br /&gt;  public static final String EOL_STRING = System&lt;br /&gt;      .getProperty("line.separator");&lt;br /&gt;&lt;br /&gt;  public String getFirstName();&lt;br /&gt;&lt;br /&gt;  public String getLastName();&lt;br /&gt;&lt;br /&gt;  public String getTitle();&lt;br /&gt;&lt;br /&gt;  public String getOrganization();&lt;br /&gt;&lt;br /&gt;  public ArrayList getAddresses();&lt;br /&gt;&lt;br /&gt;  public void setFirstName(String newFirstName);&lt;br /&gt;&lt;br /&gt;  public void setLastName(String newLastName);&lt;br /&gt;&lt;br /&gt;  public void setTitle(String newTitle);&lt;br /&gt;&lt;br /&gt;  public void setOrganization(String newOrganization);&lt;br /&gt;&lt;br /&gt;  public void addAddress(Address address);&lt;br /&gt;&lt;br /&gt;  public void removeAddress(Address address);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;---------------------------------------------------------------------------------&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;class ContactImpl implements Contact {&lt;br /&gt;  private String firstName;&lt;br /&gt;&lt;br /&gt;  private String lastName;&lt;br /&gt;&lt;br /&gt;  private String title;&lt;br /&gt;&lt;br /&gt;  private String organization;&lt;br /&gt;&lt;br /&gt;  private ArrayList addresses = new ArrayList();&lt;br /&gt;&lt;br /&gt;  public ContactImpl() {&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public ContactImpl(String newFirstName, String newLastName,&lt;br /&gt;      String newTitle, String newOrganization, ArrayList newAddresses) {&lt;br /&gt;    firstName = newFirstName;&lt;br /&gt;    lastName = newLastName;&lt;br /&gt;    title = newTitle;&lt;br /&gt;    organization = newOrganization;&lt;br /&gt;    if (newAddresses != null) {&lt;br /&gt;      addresses = newAddresses;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getFirstName() {&lt;br /&gt;    return firstName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getLastName() {&lt;br /&gt;    return lastName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getTitle() {&lt;br /&gt;    return title;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String getOrganization() {&lt;br /&gt;    return organization;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public ArrayList getAddresses() {&lt;br /&gt;    return addresses;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setFirstName(String newFirstName) {&lt;br /&gt;    firstName = newFirstName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setLastName(String newLastName) {&lt;br /&gt;    lastName = newLastName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setTitle(String newTitle) {&lt;br /&gt;    title = newTitle;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setOrganization(String newOrganization) {&lt;br /&gt;    organization = newOrganization;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void addAddress(Address address) {&lt;br /&gt;    if (!addresses.contains(address)) {&lt;br /&gt;      addresses.add(address);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void removeAddress(Address address) {&lt;br /&gt;    addresses.remove(address);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public boolean equals(Object o) {&lt;br /&gt;    if (!(o instanceof ContactImpl)) {&lt;br /&gt;      return false;&lt;br /&gt;    } else {&lt;br /&gt;      ContactImpl contact = (ContactImpl) o;&lt;br /&gt;      if (firstName.equals(contact.firstName)&lt;br /&gt;          &amp;amp;&amp;amp; lastName.equals(contact.lastName)&lt;br /&gt;          &amp;amp;&amp;amp; organization.equals(contact.organization)&lt;br /&gt;          &amp;amp;&amp;amp; title.equals(contact.title)) {&lt;br /&gt;        return true;&lt;br /&gt;      }&lt;br /&gt;      return false;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String toString() {&lt;br /&gt;    return firstName + SPACE + lastName + EOL_STRING + addresses;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class SessionClient {&lt;br /&gt;  private static final String SESSION_SERVER_SERVICE_NAME = "sessionServer";&lt;br /&gt;&lt;br /&gt;  private static final String SESSION_SERVER_MACHINE_NAME = "localhost";&lt;br /&gt;&lt;br /&gt;  private long sessionID;&lt;br /&gt;&lt;br /&gt;  private SessionServer sessionServer;&lt;br /&gt;&lt;br /&gt;  public SessionClient() {&lt;br /&gt;    try {&lt;br /&gt;      String url = "//" + SESSION_SERVER_MACHINE_NAME + "/"&lt;br /&gt;          + SESSION_SERVER_SERVICE_NAME;&lt;br /&gt;      sessionServer = (SessionServer) Naming.lookup(url);&lt;br /&gt;    } catch (RemoteException exc) {&lt;br /&gt;    } catch (NotBoundException exc) {&lt;br /&gt;    } catch (MalformedURLException exc) {&lt;br /&gt;    } catch (ClassCastException exc) {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void addContact(Contact contact) throws SessionException {&lt;br /&gt;    try {&lt;br /&gt;      sessionID = sessionServer.addContact(contact, 0);&lt;br /&gt;    } catch (RemoteException exc) {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void addAddress(Address address) throws SessionException {&lt;br /&gt;    try {&lt;br /&gt;      sessionServer.addAddress(address, sessionID);&lt;br /&gt;    } catch (RemoteException exc) {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void removeAddress(Address address) throws SessionException {&lt;br /&gt;    try {&lt;br /&gt;      sessionServer.removeAddress(address, sessionID);&lt;br /&gt;    } catch (RemoteException exc) {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void commitChanges() throws SessionException {&lt;br /&gt;    try {&lt;br /&gt;      sessionID = sessionServer.finalizeContact(sessionID);&lt;br /&gt;    } catch (RemoteException exc) {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class SessionException extends Exception {&lt;br /&gt;  public static final int CONTACT_BEING_EDITED = 1;&lt;br /&gt;&lt;br /&gt;  public static final int SESSION_ID_REQUIRED = 2;&lt;br /&gt;&lt;br /&gt;  public static final int CONTACT_SELECT_REQUIRED = 3;&lt;br /&gt;&lt;br /&gt;  public static final int ADDRESS_DOES_NOT_EXIST = 4;&lt;br /&gt;&lt;br /&gt;  private int errorCode;&lt;br /&gt;&lt;br /&gt;  public SessionException(String cause, int newErrorCode) {&lt;br /&gt;    super(cause);&lt;br /&gt;    errorCode = newErrorCode;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public SessionException(String cause) {&lt;br /&gt;    super(cause);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public int getErrorCode() {&lt;br /&gt;    return errorCode;&lt;br /&gt;  }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-92773475923816471?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/92773475923816471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=92773475923816471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/92773475923816471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/92773475923816471'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/09/session-pattern-examples-in-java.html' title='Session Pattern Examples in Java'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2598441418087372655</id><published>2008-09-07T04:09:00.000-07:00</published><updated>2008-09-07T04:14:35.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><title type='text'>What is Cookie</title><content type='html'>&lt;span style="font-weight:bold;"&gt;cookie&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;(1) A small amount of data sent back to the requesting party by the recipient. Also called a "magic cookie," it provides information about the transaction, such as an ID or session number, which may be required later either by the recipient or a third party. This is the same concept as definition #2 below, but not specific to the Web.&lt;br /&gt;&lt;br /&gt;(2) A small data file created by a Web server that is stored on your computer either temporarily for that session only or permanently on the hard disk (persistent cookie). Cookies provide a way for the Web site to recognize you and keep track of your preferences.&lt;br /&gt;&lt;br /&gt;Cookies Are Beneficial&lt;br /&gt;Cookies are commonly used to "maintain the state" of the session as a user browses around the site. The shopping cart is an example. You can place an item in the cart, switch to another page or even another site, and when you come back, the site knows who you are, and you can continue with the order. Without cookies, the site would not be able to identify you automatically because the Internet is "stateless." See &lt;span style="font-weight:bold;"&gt;state&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;stateless.&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     Cookies contain a range of URLs (addresses) for which they are valid. When the Web browser or other HTTP application sends a request to a Web server with those URLs again, it also sends along the related cookies. For example, if your user ID and password are stored in a cookie, it saves you from typing in the same information all over again when accessing that service the next time. By retaining user history, cookies allow the Web site to tailor the pages and create a custom experience for that individual.&lt;br /&gt;&lt;br /&gt;Your Cookies Know You&lt;br /&gt;Quite a bit of personal data may reside in the cookie files in your computer. As a result, this storehouse of private information is sometimes the object of attack (see &lt;span style="font-style:italic;"&gt;cookie poisoning&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;.)&lt;br /&gt;&lt;br /&gt;First-Party Cookies&lt;br /&gt;The default settings in your Web browser typically allow "first-party" cookies, but not "third-party" cookies. First-party cookies are created by the Web site you are visiting and are necessary to keep track of your preferences and the current session as explained above.&lt;br /&gt;&lt;br /&gt;Third-Party Tracking Cookies&lt;br /&gt;Third-party cookies are created by a Web site other than the one you are currently visiting; for example, by a third-party advertiser on that site. The purpose of such cookies is usually to track your surfing habits, which is why third-party cookies are considered an invasion of privacy and riskier than first-party cookies.&lt;br /&gt;&lt;br /&gt;Configuring Settings&lt;br /&gt;A Web browser can be configured so that only first-party cookies coming from the originating sites are maintained. It can also be set to prevent all cookies from being stored in your computer, but that severely limits the Web surfing experience. To change settings, look for the cookie options in your browser in the Options or Preferences menu. See &lt;span style="font-weight:bold;"&gt;Web bug&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;cookie file&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt; and &lt;span style="font-weight:bold;"&gt;state&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2598441418087372655?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2598441418087372655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2598441418087372655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2598441418087372655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2598441418087372655'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/09/what-is-cookie.html' title='&lt;marquee behavior=&quot;alternate&quot; scrollamount=&quot;2&quot; align=&quot;center&quot;&gt;&lt;b&gt;What is Cookie&lt;/b&gt;&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7326905566237139469</id><published>2008-08-27T10:33:00.000-07:00</published><updated>2008-09-07T03:30:41.023-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='variables in stored procedures'/><title type='text'>Indicator variables and stored procedures</title><content type='html'>&lt;span style="font-weight:bold;"&gt;variables and stored procedures&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Indicator variables can be used with the CALL statement, provided host variables are used for the parameters, to pass additional information to and from the procedure. Indicator variables are the SQL standard means of denoting that the associated host variable should be interpreted as containing the null value, and this is their primary use.&lt;br /&gt;&lt;br /&gt;To indicate that an associated host variable contains the null value, the indicator variable, which is a two-byte integer, is set to a negative value. A CALL statement with indicator variables is processed as follows:&lt;br /&gt;&lt;br /&gt;    * If the indicator variable is negative, this denotes the null value. A default value is passed for the associated host variable on the CALL and the indicator variable is passed unchanged.&lt;br /&gt;    * If the indicator variable is not negative, this denotes that the host variable contains a non-null value. In this case, the host variable and the indicator variable are passed unchanged.&lt;br /&gt;&lt;br /&gt;These rules of processing are the same for input parameters to the procedure as well as output parameters returned from the procedure. When indicator variables are used with stored procedures, the correct method of coding their handling is to check the value of the indicator variable first before using the associated host variable.&lt;br /&gt;&lt;br /&gt;The following example illustrates the handling of indicator variables in CALL statements. Notice that the logic checks the value of the indicator variable before using the associated variable. Also note the method that the indicator variables are passed into procedure PROC1 (as a third argument consisting of an array of two-byte values).&lt;br /&gt;&lt;br /&gt;Assume a procedure was defined as follows:&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;CREATE PROCEDURE PROC1&lt;br /&gt;    (INOUT DECIMALOUT DECIMAL(7,2), INOUT DECOUT2 DECIMAL(7,2))&lt;br /&gt;    EXTERNAL NAME LIB1.PROC1 LANGUAGE RPGLE&lt;br /&gt;    GENERAL WITH NULLS)&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Figure 5. Handling of Indicator Variables in CALL Statements&lt;br /&gt;&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;Program CRPG&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;    D INOUT1          S              7P 2&lt;br /&gt;    D INOUT1IND       S              4B 0&lt;br /&gt;    D INOUT2          S              7P 2&lt;br /&gt;    D INOUT2IND       S              4B 0&lt;br /&gt;    C                   EVAL      INOUT1 = 1&lt;br /&gt;    C                   EVAL      INOUT1IND  = 0&lt;br /&gt;    C                   EVAL      INOUT2 = 1&lt;br /&gt;    C                   EVAL      INOUT2IND = -2&lt;br /&gt;    C/EXEC SQL CALL PROC1 (:INOUT1 :INOUT1IND , :INOUT2&lt;br /&gt;    C+                         :INOUT2IND)&lt;br /&gt;    C/END-EXEC&lt;br /&gt;    C                   EVAL      INOUT1 = 1&lt;br /&gt;    C                   EVAL      INOUT1IND  = 0&lt;br /&gt;    C                   EVAL      INOUT2 = 1&lt;br /&gt;    C                   EVAL      INOUT2IND = -2&lt;br /&gt;    C/EXEC SQL CALL PROC1 (:INOUT1 :INOUT1IND , :INOUT2&lt;br /&gt;    C+                         :INOUT2IND)&lt;br /&gt;    C/END-EXEC&lt;br /&gt;    C     INOUT1IND     IFLT      0&lt;br /&gt;    C*                   :&lt;br /&gt;    C*                  HANDLE NULL INDICATOR&lt;br /&gt;    C*                   :&lt;br /&gt;    C                   ELSE&lt;br /&gt;    C*                   :&lt;br /&gt;    C*                  INOUT1 CONTAINS VALID DATA&lt;br /&gt;    C*                   :&lt;br /&gt;    C                   ENDIF&lt;br /&gt;    C*                   :&lt;br /&gt;    C*                  HANDLE ALL OTHER PARAMETERS&lt;br /&gt;    C*                  IN A SIMILAR FASHION&lt;br /&gt;    C*                   :&lt;br /&gt;    C                   RETURN&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;End of PROGRAM CRPG&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;Program PROC1&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;    D INOUTP          S              7P 2&lt;br /&gt;    D INOUTP2         S              7P 2&lt;br /&gt;    D NULLARRAY       S              4B 0 DIM(2)&lt;br /&gt;    C     *ENTRY        PLIST&lt;br /&gt;    C                   PARM                    INOUTP&lt;br /&gt;    C                   PARM                    INOUTP2&lt;br /&gt;    C                   PARM                    NULLARRAY&lt;br /&gt;    C     NULLARRAY(1)  IFLT      0&lt;br /&gt;    C*                   :&lt;br /&gt;    C*                  INOUTP DOES NOT CONTAIN MEANINGFUL DATA&lt;br /&gt;    C*&lt;br /&gt;    C                   ELSE&lt;br /&gt;    C*                   :&lt;br /&gt;    C*                  INOUTP CONTAINS MEANINGFUL DATA&lt;br /&gt;    C*                   :&lt;br /&gt;    C                   ENDIF&lt;br /&gt;    C*                  PROCESS ALL REMAINING VARIABLES&lt;br /&gt;    C*&lt;br /&gt;    C*                  BEFORE RETURNING, SET OUTPUT VALUE FOR FIRST&lt;br /&gt;    C*                  PARAMETER AND SET THE INDICATOR TO A NON-NEGATIV&lt;br /&gt;    C*                  VALUE SO THAT THE DATA IS RETURNED TO THE CALLING&lt;br /&gt;    C*                  PROGRAM&lt;br /&gt;    C*&lt;br /&gt;    C                   EVAL      INOUTP2 = 20.5&lt;br /&gt;    C                   EVAL      NULLARRAY(2) = 0&lt;br /&gt;    C*&lt;br /&gt;    C*                  INDICATE THAT THE SECOND PARAMETER IS TO CONTAIN&lt;br /&gt;    C*                  THE NULL VALUE UPON RETURN. THERE IS NO POINT&lt;br /&gt;    C*                  IN SETTING THE VALUE IN INOUTP SINCE IT WON'T BE&lt;br /&gt;    C*                  PASSED BACK TO THE CALLER.&lt;br /&gt;    C                   EVAL      NULLARRAY(1) = -5&lt;br /&gt;    C                   RETURN&lt;br /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;End of PROGRAM PROC1&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7326905566237139469?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7326905566237139469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7326905566237139469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7326905566237139469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7326905566237139469'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/indicator-variables-and-stored.html' title='&lt;marquee behavior=&quot;alternate&quot; direction=&quot;right&quot; scrollamount=&quot;2&quot; align=&quot;center&quot;&gt;&lt;b&gt;Indicator variables and stored procedures&lt;/b&gt;&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-4765630162795101081</id><published>2008-08-27T10:32:00.000-07:00</published><updated>2008-09-07T03:32:11.892-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='result set in stored procedure'/><title type='text'>Returning Result Sets from Stored Procedures</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Result Sets from Stored Procedures&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In addition to returning output parameters, stored procedures have a feature by which a result table associated with a cursor opened in the stored procedure (called a result set) can be returned to the application issuing the CALL statement. That application can then issue fetch requests to read the rows of the result set cursor. Whether a result set gets returned depends on the returnability attribute of the cursor. The cursor's returnability attribute can be explicitly given in the DECLARE CURSOR statement or it can be defaulted. The SET RESULT SETS statement also allows for an indication of where the result sets should be returned (see Example 2: Call a stored procedure which returns a result set from a nested procedure). By default, cursors which are opened in a stored procedure are defined to have a returnability attribute of RETURN TO CALLER. To return the result set associated with the cursor to the application which called the outermost procedure in the call stack, the returnability attribute of RETURN TO CLIENT is specified on the DECLARE CURSOR statement. This will allow inner procedures to return result sets when the application calls nested procedures. For cursors whose result sets are never to be returned to caller or client, the returnability attribute of WITHOUT RETURN is specified on the DECLARE CURSOR statement.&lt;br /&gt;&lt;br /&gt;There are many cases where opening the cursor in a stored procedure and returning its result set provides advantages over opening the cursor directly in the application. For instance, security to the tables referenced in the query can be adopted from the stored procedure so that users of the application do not need to be granted direct authority to the tables. Instead, they are given authority to call the stored procedure, which is compiled with adequate authority to access the tables. Another advantage to opening the cursors in the stored procedure is that multiple result sets can be returned from a single call to the stored procedure, which can be more efficient that opening the cursors separately from the calling application. Additionally, each call to the same stored procedure may return a different number of result sets, providing some application versatility.&lt;br /&gt;&lt;br /&gt;The interfaces that can work with stored procedure result sets include JDBC, CLI, and ODBC. An example on how to use these API interfaces for working with stored procedure result sets is included in the following examples:&lt;br /&gt;&lt;br /&gt;    * Example 1: Call a stored procedure which returns a single result set&lt;br /&gt;    * Example 2: Call a stored procedure which returns a result set from a nested procedure&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;See Code disclaimer information for information pertaining to code examples.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-4765630162795101081?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/4765630162795101081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=4765630162795101081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4765630162795101081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4765630162795101081'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/returning-result-sets-from-stored.html' title='&lt;marquee behavior=&quot;alternate&quot; scrollamount=&quot;2&quot; width=&quot;400&quot; align=&quot;center&quot;&gt;&lt;b&gt;Returning Result Sets from Stored Procedures&lt;/b&gt;&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2674809931966962346</id><published>2008-08-27T10:30:00.000-07:00</published><updated>2008-09-07T03:23:20.380-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stored procedure'/><title type='text'>Invoking a Stored Procedure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Invoking a stored procedure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The SQL CALL statement calls a stored procedure. On the CALL statement, the name of the stored procedure and any arguments are specified. Arguments may be constants, special registers, or host variables. The external stored procedure specified in the CALL statement does not need to have a corresponding CREATE PROCEDURE statement. Programs created by SQL procedures can only be called by invoking the procedure name specified on the CREATE PROCEDURE statement.&lt;br /&gt;&lt;br /&gt;Although procedures are system program objects, using the CALL CL command will not typically work to call a procedure. The CALL CL command does not use the procedure definition to map the input and output parameters, nor does it pass parameters to the program using the procedure's parameter style.&lt;br /&gt;&lt;br /&gt;There are three types of CALL statements which need to be addressed since DB2® SQL for iSeries has different rules for each type. They are:&lt;br /&gt;&lt;br /&gt;    * Embedded or dynamic CALL statement where a procedure definition exists&lt;br /&gt;    * Embedded CALL statement where no procedure definition exists&lt;br /&gt;    * Dynamic CALL statement where no CREATE PROCEDURE exists&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Dynamic here refers to:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style:italic;"&gt; * A dynamically prepared and executed CALL statement&lt;br /&gt;    * A CALL statement issued in an interactive environment (for example, through STRSQL or Query Manager)&lt;br /&gt;    * A CALL statement executed in an EXECUTE IMMEDIATE statement.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Following is a discussion of each type.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;    * Using CALL statement where procedure definition exists&lt;br /&gt;    * Using embedded CALL statement where no procedure definition exists&lt;br /&gt;    * Using Embedded CALL statement with an SQLDA&lt;br /&gt;    * Using dynamic CALL statement where no CREATE PROCEDURE exists&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Additionally, you can find more examples at Examples of CALL statements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2674809931966962346?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2674809931966962346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2674809931966962346' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2674809931966962346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2674809931966962346'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/invoking-stored-procedure.html' title='&lt;marquee  behavior=&quot;alternate&quot; direction=&quot;right&quot; scrollamount=&quot;2&quot; width=&quot;400&quot; align=&quot;center&quot;&gt;&lt;b&gt;Invoking a Stored Procedure&lt;/b&gt;&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-4751124901314677478</id><published>2008-08-27T10:28:00.000-07:00</published><updated>2008-09-07T03:41:00.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='external procedure'/><title type='text'>Defining an External Procedure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;External Procedure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The CREATE PROCEDURE statement for an external procedure:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    * Names the procedure&lt;br /&gt;    * Defines the parameters and their attributes&lt;br /&gt;    * Gives other information about the procedure which the system uses when it calls the procedure.&lt;br /&gt;&lt;br /&gt;Consider the following example:&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE PROCEDURE P1&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   (INOUT PARM1 CHAR(10))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      EXTERNAL NAME MYLIB.PROC1&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    LANGUAGE C&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GENERAL WITH NULLS&lt;br /&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure P1&lt;br /&gt;    * Defines one parameter which is used both as an input parameter and an output parameter. The parameter is a character field of length ten. Parameters can be defined to be type IN, OUT, or INOUT. The parameter type determines when the values for the parameters get passed to and from the procedure.&lt;br /&gt;    * Defines the name of the program which corresponds to the procedure, which is PROC1 in MYLIB. MYLIB.PROC1 is the program which is called when the procedure is called on a CALL statement.&lt;br /&gt;    * Indicates that the procedure P1 (program MYLIB.PROC1) is written in C. The language is important since it impacts the types of parameters that can be passed. It also affects how the parameters are passed to the procedure (for example, for ILE C procedures, a NUL-terminator is passed on character, graphic, date, time, and timestamp parameters).&lt;br /&gt;    * Defines the CALL type to be GENERAL WITH NULLS. This indicates that the parameter for the procedure can possibly contain the NULL value, and therefore will like an additional argument passed to the procedure on the CALL statement. The additional argument is an array of N short integers, where N is the number of parameters that are declared in the CREATE PROCEDURE statement. In this example, the array contains only one element since there is only parameter.&lt;br /&gt;&lt;br /&gt;It is important to note that it is not necessary to define a procedure in order to call it. However, if no procedure definition is found, either from a prior CREATE PROCEDURE or from a DECLARE PROCEDURE in this program, certain restrictions and assumptions are made when the procedure is called on the CALL statement. For example, the NULL indicator argument cannot be passed. See Using embedded CALL statement where no procedure definition exists for an example of a CALL statement without a corresponding procedure definition.&lt;br /&gt;&lt;br /&gt;A cursor is a work area for a SQL statement that returns one or more rows. It allows you to fetch rows from the result set one by one. Cursors aren't particularly difficult to use, but to return a result set from a PL/SQL stored procedure, you must use a cursor variable. Cursor variables are basically pointers to cursors, and you use them to pass around references to cursors, such as a parameter to a stored procedure. The PL/SQL type of a cursor variable is REF CURSOR.&lt;br /&gt;&lt;br /&gt;To use cursor variables, you must define a REF CURSOR type. This type can be strong or weak. Strong types are tied to a specific set of a table's columns. This means a strong REF CURSOR type can only be used with queries (i.e. cursors) returning those columns. Weak types can refer to any cursor, and so are much more flexible. They do, however, sacrifice type safety.&lt;br /&gt;&lt;br /&gt;The easiest way forward is to define a weakly typed REF CURSOR in a PL/SQL package. Packages are used in PL/SQL for partitioning functionality. Below, a weak REF CURSOR type called REF_CURSOR is defined in a PL/SQL package called types.&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;&lt;br /&gt;   CREATE OR REPLACE PACKAGE types&lt;br /&gt;    AS&lt;br /&gt;        TYPE ref_cursor IS REF CURSOR;&lt;br /&gt;    END;&lt;br /&gt;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;This definition can now be used in all stored procedures to declare a variable of type REF CURSOR.&lt;br /&gt;&lt;br /&gt;We can now write a stored procedure that returns a REF CURSOR, that in JDBC we can process as a result set.&lt;br /&gt;&lt;br /&gt;Assume we start from a table defined as below.&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  CREATE TABLE STOCK_PRICES(&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     RIC VARCHAR(6) PRIMARY KEY,&lt;br /&gt;      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     PRICE NUMBER(7,2),&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      UPDATED DATE )&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Here we have a table of stock prices, with the RIC (Reuters Instrument Code) as the primary key.  We define a PL/SQL function that simply declares a cursor that returns all columns for stocks below a certain price.&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE OR REPLACE FUNCTION sp_get_stocks(v_price IN NUMBER) &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN types.ref_cursor&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   AS&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     stock_cursor types.ref_cursor;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       BEGIN&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        OPEN stock_cursor FOR &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     SELECT ric,price,updated FROM stock_prices&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     WHERE price &lt; v_price;&lt;br /&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN stock_cursor;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;These can all be created via the sqlplus command-line tool. Download the SQL script, and start up sqlplus.&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;C:\&gt;sqlplus username/password&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Once in sqlplus, run the script. If you start up sqlplus in the directory the SQL script is in, you can run it using the @ command:&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;SQL&gt;@stock_prices&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;You should get an encouraging list of messages such as "1 row created", "Package created", "Function created". If instead you get error messages such as "insufficient privileges", your user must be given additional database privileges. The predefined Oracle roles CONNECT and RESOURCE should be what you need. Login as the system user and run the below:&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;SQL&gt;GRANT CONNECT, RESOURCE TO username;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Testing the stored procedure&lt;br /&gt;&lt;br /&gt;To test the stored procedure, we can either execute it from within an environment that allows you to execute stored procedures and supply their parameters, such as SQL Navigator or Toad, or we can run it from within sqlplus.&lt;br /&gt;&lt;br /&gt;Executing a stored procedure from within sqlplus is straightforward once you know how.&lt;br /&gt;&lt;br /&gt;Firstly, start up sqlplus and declare a sqlplus variable of type refcursor. This declares a sqlplus variable of type refcursor (a sqlplus type), called "results":&lt;br /&gt;&lt;br /&gt;     &lt;font color="#330000" size="3"&gt;&lt;b&gt;SQL&gt; var results refcursor&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Next, execute the procedure, supplying a number as a parameter, and assigning the result into our variable, "results". Note the unusual syntax.&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;SQL&gt; exec :results := sp_get_stocks(20.0)&lt;br /&gt;&lt;br /&gt;    PL/SQL procedure successfully completed.&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Finally, use the sqlplus print statement to print out the result set&lt;br /&gt;&lt;br /&gt;   &lt;font color="#330000" size="3"&gt;&lt;b&gt; SQL&gt; print results&lt;br /&gt;&lt;br /&gt;    RIC PRICE UPDATED&lt;br /&gt;    ------ --------- ---------&lt;br /&gt;    AMZN 15.5 21-OCT-01&lt;br /&gt;    SUNW 16.25 21-OCT-01&lt;br /&gt;    ORCL 14.5 21-OCT-01&lt;br /&gt;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;If this works successfully, similar to the above, the stored procedure (well, function) is working correctly.&lt;br /&gt;Calling the stored procedure from Java&lt;br /&gt;&lt;br /&gt;There are some Oracle-specific tricks to calling the above stored procedure from Java.&lt;br /&gt;&lt;br /&gt;The query string can be in the Oracle format or the standard JDBC callable statement syntax. If you are using the Oracle syntax, the query string is:&lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;begin ? := sp_get_stocks(?); end;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;If you are using the JDBC syntax, the query string is: &lt;br /&gt;&lt;br /&gt;    &lt;font color="#330000" size="3"&gt;&lt;b&gt;{ call ? := sp_get_stocks(?) }&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;In each case the spacing is important - the query will not work otherwise.&lt;br /&gt;&lt;br /&gt;Secondly, the out parameter must be registered to be of type OracleTypes.CURSOR.&lt;br /&gt;&lt;br /&gt;And finally, use getObject() to retrieve the result set.&lt;br /&gt;&lt;br /&gt;The code (without error handling) is illustrated below. A more complete code sample can be downloaded from here.&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String query = "begin ? := sp_get_stocks(?); end;";&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    CallableStatement stmt = conn.prepareCall(query);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// register the type of the out param - an Oracle specific type&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    stmt.registerOutParameter(1, OracleTypes.CURSOR);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    // set the in param&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    stmt.setFloat(2, price);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    // execute and retrieve the result set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    stmt.execute();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    ResultSet rs = (ResultSet)stmt.getObject(1);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    // print the results&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    while (rs.next()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        System.out.println(rs.getString(1) + "\t" +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            rs.getFloat(2) + "\t" +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            rs.getDate(3).toString());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Hopefully, this code will be all you need to get started on calling your own Oracle stored procedures via JDBC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-4751124901314677478?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/4751124901314677478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=4751124901314677478' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4751124901314677478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4751124901314677478'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/defining-external-procedure.html' title='&lt;marquee behavior=&quot;alternate&quot; direction=&quot;right&quot; scrollamount=&quot;2&quot; width=&quot;400&quot; align=&quot;center&quot;&gt;&lt;b&gt;Defining an External Procedure&lt;/b&gt;&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-3242579464515711404</id><published>2008-08-27T10:09:00.000-07:00</published><updated>2008-08-27T10:28:06.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stored sql procedure'/><category scheme='http://www.blogger.com/atom/ns#' term='sql procedure'/><title type='text'>Defining an SQL Procedure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;SQL Procedure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The CREATE PROCEDURE statement for SQL procedures:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    * Names the procedure&lt;br /&gt;    * Defines the parameters and their attributes&lt;br /&gt;    * Provides other information about the procedure which will be used when the procedure is called&lt;br /&gt;    * Defines the procedure body. The procedure body is the executable part of the procedure and is a single SQL statement.&lt;br /&gt;&lt;br /&gt;Consider the following simple example that takes as input an employee number and a rate and updates the employee's salary:&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE PROCEDURE UPDATE_SALARY_1&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(IN EMPLOYEE_NUMBER CHAR(10),&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IN RATE DECIMAL(6,2))&lt;br /&gt;          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LANGUAGE SQL MODIFIES SQL DATA&lt;br /&gt;          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPDATE CORPDATA.EMPLOYEE&lt;br /&gt;            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET SALARY = SALARY * RATE&lt;br /&gt;            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE EMPNO = EMPLOYEE_NUMBER &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure UPDATE_SALARY_1.&lt;br /&gt;    * Defines parameter EMPLOYEE_NUMBER which is an input parameter and is a character data type of length 6 and parameter RATE which is an input parameter and is a decimal data type.&lt;br /&gt;    * Indicates the procedure is an SQL procedure that modifies SQL data.&lt;br /&gt;    * Defines the procedure body as a single UPDATE statement. When the procedure is called, the UPDATE statement is executed using the values passed for EMPLOYEE_NUMBER and RATE.&lt;br /&gt;&lt;br /&gt;Instead of a single UPDATE statement, logic can be added to the SQL procedure using SQL control statements. SQL control statements consist of the following:&lt;br /&gt;&lt;br /&gt;    * an assignment statement&lt;br /&gt;    * a CALL statement&lt;br /&gt;    * a CASE statement&lt;br /&gt;    * a compound statement&lt;br /&gt;    * a FOR statement&lt;br /&gt;    * a GET DIAGNOSTICS statement&lt;br /&gt;    * a GOTO statement&lt;br /&gt;    * an IF statement&lt;br /&gt;    * an ITERATE statement&lt;br /&gt;    * a LEAVE statement&lt;br /&gt;    * a LOOP statement&lt;br /&gt;    * a REPEAT statement&lt;br /&gt;    * a RESIGNAL statement&lt;br /&gt;    * a RETURN statement&lt;br /&gt;    * a SIGNAL statement&lt;br /&gt;    * a WHILE statement&lt;br /&gt;&lt;br /&gt;The following example takes as input the employee number and a rating that was received on the last evaluation. The procedure uses a CASE statement to determine the appropriate increase and bonus for the update:&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE PROCEDURE UPDATE_SALARY_2&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  (IN EMPLOYEE_NUMBER CHAR(6),&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  IN RATING INT)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  LANGUAGE SQL MODIFIES SQL DATA&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     CASE RATING&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       WHEN 1 THEN&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         UPDATE CORPDATA.EMPLOYEE&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           SET SALARY = SALARY * 1.10,&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            BONUS = 1000&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           WHERE EMPNO = EMPLOYEE_NUMBER;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       WHEN 2 THEN&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        UPDATE CORPDATA.EMPLOYEE&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          SET SALARY = SALARY * 1.05,&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         BONUS = 500&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         WHERE EMPNO = EMPLOYEE_NUMBER;&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    ELSE&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        UPDATE CORPDATA.EMPLOYEE&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          SET SALARY = SALARY * 1.03,&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           BONUS = 0&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           WHERE EMPNO = EMPLOYEE_NUMBER;&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    END CASE&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure UPDATE_SALARY_2.&lt;br /&gt;    * Defines parameter EMPLOYEE_NUMBER which is an input parameter and is a character data type of length 6 and parameter RATING which is an input parameter and is an integer data type.&lt;br /&gt;    * Indicates the procedure is an SQL procedure that modifies SQL data.&lt;br /&gt;    * Defines the procedure body. When the procedure is called, input parameter RATING is checked and the appropriate update statement is executed.&lt;br /&gt;&lt;br /&gt;Multiple statements can be added to a procedure body by adding a compound statement. Within a compound statement, any number of SQL statements can be specified. In addition, SQL variables, cursors, and handlers can be declared.&lt;br /&gt;&lt;br /&gt;The following example takes as input the department number. It returns the total salary of all the employees in that department and the number of employees in that department who get a bonus.&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE PROCEDURE RETURN_DEPT_SALARY&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         (IN DEPT_NUMBER CHAR(3),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          OUT DEPT_SALARY DECIMAL(15,2),&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         OUT DEPT_BONUS_CNT INT)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        LANGUAGE SQL READS SQL DATA&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        P1: BEGIN&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE EMPLOYEE_SALARY DECIMAL(9,2);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE EMPLOYEE_BONUS DECIMAL(9,2);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE TOTAL_SALARY DECIMAL(15,2)DEFAULT 0;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE BONUS_CNT INT DEFAULT 0;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        DECLARE END_TABLE INT DEFAULT 0;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE C1 CURSOR FOR&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         SELECT SALARY, BONUS FROM CORPDATA.EMPLOYEE&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          WHERE WORKDEPT = DEPT_NUMBER;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        DECLARE CONTINUE HANDLER FOR NOT FOUND&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          SET END_TABLE = 1;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        DECLARE EXIT HANDLER FOR SQLEXCEPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET DEPT_SALARY = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OPEN C1;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        FETCH C1 INTO EMPLOYEE_SALARY, EMPLOYEE_BONUS;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        WHILE END_TABLE = 0 DO&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET TOTAL_SALARY = TOTAL_SALARY + EMPLOYEE_SALARY + EMPLOYEE_BONUS;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            IF EMPLOYEE_BONUS &gt; 0 THEN&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              SET BONUS_CNT = BONUS_CNT + 1;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            END IF;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            FETCH C1 INTO EMPLOYEE_SALARY, EMPLOYEE_BONUS;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          END WHILE;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          CLOSE C1;&lt;br /&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        SET DEPT_SALARY = TOTAL_SALARY;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          SET DEPT_BONUS_CNT = BONUS_CNT;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       END P1  &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;        &lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure RETURN_DEPT_SALARY.&lt;br /&gt;    * Defines parameter DEPT_NUMBER which is an input parameter and is a character data type of length 3, parameter DEPT_SALARY which is an output parameter and is a decimal data type, and parameter DEPT_BONUS_CNT which is an output parameter and is an integer data type.&lt;br /&gt;    * Indicates the procedure is an SQL procedure that reads SQL data&lt;br /&gt;    * Defines the procedure body.&lt;br /&gt;          o Declares SQL variables EMPLOYEE_SALARY and TOTAL_SALARY as decimal fields.&lt;br /&gt;          o Declares SQL variables BONUS_CNT and END_TABLE which are integers and are initialized to 0.&lt;br /&gt;          o Declares cursor C1 that selects the columns from the employee table.&lt;br /&gt;          o Declares a continue handler for NOT FOUND, which, when called sets variable END_TABLE to 1. This handler is called when the FETCH has no more rows to return. When the handler is called, SQLCODE and SQLSTATE are reinitialized to 0.&lt;br /&gt;          o Declares an exit handler for SQLEXCEPTION. If called, DEPT_SALARY is set to NULL and the processing of the compound statement is terminated. This handler is called if any errors occur, that is, the SQLSTATE class is not '00', '01' or '02'. Since indicators are always passed to SQL procedures, the indicator value for DEPT_SALARY is -1 when the procedure returns. If this handler is called, SQLCODE and SQLSTATE are reinitialized to 0.&lt;br /&gt;&lt;br /&gt;            If the handler for SQLEXCEPTION is not specified and an error occurs that is not handled in another handler, execution of the compound statement is terminated and the error is returned in the SQLCA. Similar to indicators, the SQLCA is always returned from SQL procedures.&lt;br /&gt;          o Includes an OPEN, FETCH, and CLOSE of cursor C1. If a CLOSE of the cursor is not specified, the cursor is closed at the end of the compound statement since SET RESULT SETS is not specified in the CREATE PROCEDURE statement.&lt;br /&gt;          o Includes a WHILE statement which loops until the last record is fetched. For each row retrieved, the TOTAL_SALARY is incremented and, if the employee's bonus is more than 0, the BONUS_CNT is incremented.&lt;br /&gt;          o Returns DEPT_SALARY and DEPT_BONUS_CNT as output parameters.&lt;br /&gt;&lt;br /&gt;Compound statements can be made atomic so if an error occurs that is not expected, the statements within the atomic statement are rolled back. The atomic compound statements are implemented using SAVEPOINTS. If the compound statement is successful, the transaction is committed. For more information about using SAVEPOINTS, see Savepoints.&lt;br /&gt;&lt;br /&gt;The following example takes as input the department number. It ensures the EMPLOYEE_BONUS table exists, and inserts the name of all employees in the department who get a bonus. The procedure returns the total count of all employees who get a bonus.&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE PROCEDURE CREATE_BONUS_TABLE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (IN DEPT_NUMBER CHAR(3),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   INOUT CNT INT)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   LANGUAGE SQL MODIFIES SQL DATA&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    CS1: BEGIN ATOMIC&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     DECLARE NAME VARCHAR(30) DEFAULT NULL;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      DECLARE CONTINUE HANDLER FOR SQLSTATE '42710'&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        SELECT COUNT(*) INTO CNT&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          FROM DATALIB.EMPLOYEE_BONUS;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           DECLARE CONTINUE HANDLER FOR SQLSTATE '23505'&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            SET  CNT = CNT - 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              DECLARE UNDO HANDLER FOR SQLEXCEPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               SET CNT = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                 IF DEPT_NUMBER IS NOT NULL THEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                   CREATE TABLE DATALIB.EMPLOYEE_BONUS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    (FULLNAME VARCHAR(30),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    BONUS DECIMAL(10,2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    PRIMARY KEY (FULLNAME));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                    FOR_1:FOR V1 AS C1 CURSOR FOR&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                   SELECT FIRSTNME, MIDINIT, LASTNAME, BONUS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                 FROM CORPDATA.EMPLOYEE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                 WHERE WORKDEPT = CREATE_BONUS_TABLE.DEPT_NUMBER&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                 DO&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                 IF BONUS &gt; 0 THEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                SET NAME = FIRSTNME CONCAT ' ' CONCAT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                MIDINIT  CONCAT ' 'CONCAT LASTNAME;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              INSERT INTO DATALIB.EMPLOYEE_BONUS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             VALUES(CS1.NAME, FOR_1.BONUS);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           SET CNT = CNT + 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         END IF;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       END FOR FOR_1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     END IF;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   END CS1         &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure CREATE_BONUS_TABLE.&lt;br /&gt;    * Defines parameter DEPT_NUMBER which is an input parameter and is a character data type of length 3 and parameter CNT which is an input/output parameter and is an integer data type.&lt;br /&gt;    * Indicates the procedure is an SQL procedure that modifies SQL data&lt;br /&gt;    * Defines the procedure body.&lt;br /&gt;          o Declares SQL variable NAME as varying character.&lt;br /&gt;          o Declares a continue handler for SQLSTATE 42710, table already exists. If the EMPLOYEE_BONUS table already exists, the handler is called and retrieves the number of records in the table. The SQLCODE and SQLSTATE are reset to 0 and processing continues with the FOR statement.&lt;br /&gt;          o Declares a continue handler for SQLSTATE 23505, duplicate key. If the procedure attempts to insert a name that already exists in the table, the handler is called and decrements CNT. Processing continues on the SET statement following the INSERT statement.&lt;br /&gt;          o Declares an UNDO handler for SQLEXCEPTION. If called, the previous statements are rolled back, CNT is set to 0, and processing continues after the compound statement. In this case, since there is no statement following the compound statement, the procedure returns.&lt;br /&gt;          o Uses the FOR statement to declare cursor C1 to read the records from the EMPLOYEE table. Within the FOR statement, the column names from the select list are used as SQL variables that contain the data from the row fetched. For each row, data from columns FIRSTNME, MIDINIT, and LASTNAME are concatenated together with a blank in between and the result is put in SQL variable NAME. SQL variables NAME and BONUS are inserted into the EMPLOYEE_BONUS table. Because the data type of the select list items must be known when the procedure is created, the table specified in the FOR statement must exist when the procedure is created.&lt;br /&gt;&lt;br /&gt;            An SQL variable name can be qualified with the label name of the FOR statement or compound statement in which it is defined. In the example, FOR_1.BONUS refers to the SQL variable that contains the value of column BONUS for each row selected. CS1.NAME is the variable NAME defined in the compound statement with the beginning label CS1. Parameter names can also be qualified with the procedure name. CREATE_BONUS_TABLE.DEPT_NUMBER is the DEPT_NUMBER parameter for the procedure CREATE_BONUS_TABLE. If unqualified SQL variable names are used in SQL statements where column names are also allowed, and the variable name is the same as a column name, the name will be used to refer to the column.&lt;br /&gt;&lt;br /&gt;You can also use dynamic SQL in an SQL procedure. The following example creates a table that contains all employees in a specific department. The department number is passed as input to the procedure and is concatenated to the table name.&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #E2E2E2;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE PROCEDURE CREATE_DEPT_TABLE (IN P_DEPT CHAR(3))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  LANGUAGE SQL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     DECLARE STMT CHAR(1000);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      DECLARE MESSAGE CHAR(20);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        DECLARE TABLE_NAME CHAR(30);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         DECLARE CONTINUE HANDLER FOR SQLEXCEPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           SET MESSAGE = 'ok';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           SET TABLE_NAME = 'CORPDATA.DEPT_' CONCAT P_DEPT CONCAT '_T';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               SET STMT = 'DROP TABLE ' CONCAT TABLE_NAME;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               PREPARE S1 FROM STMT;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               EXECUTE S1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               SET STMT = 'CREATE TABLE ' CONCAT TABLE_NAME CONCAT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            '(EMPNO CHAR(6) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            FIRSTNME VARCHAR(12) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            MIDINIT CHAR(1) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            LASTNAME CHAR(15) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            SALARY DECIMAL(9,2))';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;          PREPARE S2 FROM STMT;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         EXECUTE S2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        SET STMT = 'INSERT INTO ' CONCAT TABLE_NAME CONCAT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      'SELECT EMPNO, FIRSTNME, MIDINIT, LASTNAME, SALARY&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      FROM CORPDATA.EMPLOYEE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     WHERE  WORKDEPT = ?';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   PREPARE S3 FROM STMT;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  EXECUTE S3 USING P_DEPT;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This CREATE PROCEDURE statement:&lt;br /&gt;&lt;br /&gt;    * Names the procedure CREATE_DEPT_TABLE&lt;br /&gt;    * Defines parameter P_DEPT which is an input parameter and is a character data type of length 3.&lt;br /&gt;    * Indicates the procedure is an SQL procedure.&lt;br /&gt;    * Defines the procedure body.&lt;br /&gt;          o Declares SQL variable STMT and an SQL variable TABLE_NAME as character.&lt;br /&gt;          o Declares a CONTINUE handler. The procedure attempts to DROP the table in case it already exists. If the table does not exist, the first EXECUTE fails. With the handler, processing will continue.&lt;br /&gt;          o Sets variable TABLE_NAME to 'DEPT_' followed by the characters passed in parameter P_DEPT, followed by '_T'.&lt;br /&gt;          o Sets variable STMT to the DROP statement, and prepares and executes the statement.&lt;br /&gt;          o Sets variable STMT to the CREATE statement, and prepares and executes the statement.&lt;br /&gt;          o Sets variable STMT to the INSERT statement, and prepares and executes the statement. A parameter marker is specified in the where clause. When the statement is executed, the variable P_DEPT is passed on the USING clause.&lt;br /&gt;&lt;br /&gt;If the procedure is called passing value 'D21' for the department, table DEPT_D21_T is created and the table is initialized with all the employees that are in department 'D21'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-3242579464515711404?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/3242579464515711404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=3242579464515711404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/3242579464515711404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/3242579464515711404'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/defining-sql-procedure.html' title='Defining an SQL Procedure'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7592278312689254951</id><published>2008-08-27T10:04:00.000-07:00</published><updated>2008-08-27T10:09:24.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stored procedures in java'/><title type='text'>Define Stored Procedure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Stored procedures are precompiled database queries that improve the security, efficiency and usability of database client/server applications. Developers specify a stored procedure in terms of input and output variables. They then compile the code on the database platform and make it available to aplication developers for use in other environments, such as web applications. &lt;br /&gt;&lt;br /&gt;All of the major database platforms, including Oracle, SQL Server and MySQL support stored procedures. The major benefits of this technology are the substantial performance gains from precompiled execution, the reduction of client/server traffic, development efficiency gains from code reuse and abstraction and the security controls inherent in granting users permissions on specific stored procedures instead of the underlying database tables.&lt;br /&gt;&lt;br /&gt;You would think that returning a JDBC result set from an Oracle PL/SQL stored procedure would be quite straightforward. Unfortunately, it's not as easy as it sounds. But reading this article should tell you all you need to know. Any contributions or corrections welcome - please post on our discussion forum. Sorry, but we can't reply to individual emails.&lt;br /&gt;&lt;br /&gt;There are three basic steps. First, you have to write the stored procedure - which in Oracle is a bit tricky if you're not familiar with PL/SQL. Testing it using the Oracle command-line tool sqlplus is also quirky. And calling it via JDBC isn't exactly standard either. &lt;br /&gt;Writing the stored procedure&lt;br /&gt;&lt;br /&gt;If you are used to Sybase or SQLServer, returning a result set from a stored procedure is easy. Just finish the procedure with a "select x,y,z from my_table", selecting whatever columns you wish to return.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7592278312689254951?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7592278312689254951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7592278312689254951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7592278312689254951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7592278312689254951'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/define-stored-procedure.html' title='Define Stored Procedure'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1608369628759275518</id><published>2008-08-25T09:45:00.000-07:00</published><updated>2008-09-07T03:44:21.911-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jvm'/><title type='text'>JVM (Java Virtual Machine)</title><content type='html'>Acronym for Java Virtual Machine. An abstract computing machine, or virtual machine, JVM is a platform-independent execution environment that converts Java bytecode into machine language and executes it. Most programming languages compile source code directly into machine code that is designed to run on a specific microprocessor architecture or operating system, such as Windows or UNIX. A JVM -- a machine within a machine -- mimics a real Java processor, enabling Java bytecode to be executed as actions or operating system calls on any processor regardless of the operating system. For example, establishing a socket connection from a workstation to a remote machine involves an operating system call. Since different operating systems handle sockets in different ways, the JVM translates the programming code so that the two machines that may be on different platforms are able to connect.&lt;br /&gt;&lt;br /&gt;JVMs are not the only virtual machines being used today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-1608369628759275518?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/1608369628759275518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=1608369628759275518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1608369628759275518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1608369628759275518'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/jvm-java-virtual-machine.html' title='&lt;marquee behavior=&quot;alternate&quot; scrollamount=&quot;2&quot; align=&quot;center&quot;&gt;JVM (Java Virtual Machine)&lt;/marquee&gt;'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2894591406829007983</id><published>2008-08-25T09:07:00.000-07:00</published><updated>2008-08-25T09:41:40.577-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java virtual machine'/><category scheme='http://www.blogger.com/atom/ns#' term='jvm'/><title type='text'>Defining JVM(Java Virtual Machine)</title><content type='html'>&lt;strong&gt;&lt;u&gt;&lt;font color="#FF00CC" size="3"&gt;NAME&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Java::JVM::Classfile - Parse JVM Classfiles&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;font color="#FF00CC" size="3"&gt;SYNOPSIS&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 130px; background-color: #CCCCCC;"&gt;&lt;br /&gt;  &lt;center&gt;use Java::JVM::Classfile;&lt;br /&gt;&lt;br /&gt;  my $c = Java::JVM::Classfile-&gt;new("HelloWorld.class");&lt;br /&gt;  print "Class: " . $c-&gt;class . "\n";&lt;br /&gt;  print "Methods: " . scalar(@{$c-&gt;methods}) . "\n";&lt;/center&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;font color="#FF00CC" size="3"&gt;DESCRIPTION&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Java Virtual Machine (JVM) is an abstract machine which processes JVM classfiles. Such classfiles contain, broadly speaking, representations of the Java methods and member fields forming the definition of a single class, information to support the exception mechanism and a system for representing additional class attributes. The JVM itself exists primarily to load and link classfiles into the running machine on demand (performed by the Class Loader), represent those classes internally by means of a number of runtime data structures and facilitate execution (a role shared between the Execution Engine (which is responsible for execution of JVM instructions) and the Native Method Interface which allows a Java program to execute non-Java code, generally ANSI C/C++.&lt;br /&gt;&lt;br /&gt;This Perl module reveals the information in a highly-compressed JVM classfile by representing the information as a series of objects. It is hoped that this module will eventually lead to a JVM implementation in Perl (or Parrot), or possibly a way-ahead-of-time (WAT) to Perl (or Parrot) compiler for Java.&lt;br /&gt;&lt;br /&gt;It is important to remember that the Java classfile is highly-compressed. Classfiles are intended to be as small as possible as they are often sent across the network. This may explain the slightly odd object tree. One of the most important things to consider is the idea of a constant pool. All constants (constant strings, method names and signatures etc.) are clustered in the constant pool at the start of the classfile, and sprinkled throughout the file are references to the constant pool. The module attempts to hide this optimisation as much as possible from the user, however.&lt;br /&gt;&lt;br /&gt;It is probably important to at least have briefly read "The JavaTM Virtual Machine Specification", http://java.sun.com/docs/books/vmspec/&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color=#FF00CC size=3&gt;METHODS &lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/br&gt;&lt;br /&gt;&lt;b&gt;new&lt;/b&gt;&lt;br /&gt;This is the constructor, it takes the filename of the classfile to parse and returns an object:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;my $c = Java::JVM::Classfile-&gt;new("HelloWorld.class");&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;magic&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the magic number for the classfile. All valid classfiles should have the magic number 0xCAFEBABE:&lt;br /&gt;&lt;br /&gt;    &lt;font color="#660033" size="2"&gt;my $magic = $c-&gt;magic;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;version&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the version of the classfile. The version consists of a major number and a minor number. For example, "45.3" has major number 45 and minor number 3:&lt;br /&gt;&lt;br /&gt;    &lt;font color="#660033" size="2"&gt;my $version = $c-&gt;version;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;class&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the name of the class that this classfile corresponds to:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;my $class = $c-&gt;class;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;superclass&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the name of the superclass of the class that this classfile corresponds to:&lt;br /&gt;&lt;br /&gt;   &lt;font color="#660033" size="2"&gt;my $superclass = $c-&gt;superclass;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;constant_pool&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the constant pool entries as an array reference. Each entry is an object. Currently undocumented.&lt;br /&gt;&lt;br /&gt;   &lt;font color="#660033" size="2"&gt;my $constant_pool = $c-&gt;constant_pool;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;access_flags&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns the access flags for the class as an array reference. Possible flags are:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;abstract&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared abstract; may not be instantiated&lt;br /&gt;&lt;b&gt;final&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared final; no subclasses allowed&lt;br /&gt;&lt;b&gt;interface&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Is an interface, not a class&lt;br /&gt;&lt;b&gt;public&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared public; may be accessed from outside its package&lt;br /&gt;&lt;b&gt;super&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Treat superclass methods specially when invoked by the invokespecial instruction&lt;br /&gt;&lt;br /&gt;   &lt;font color="#660033" size="2"&gt;print "Flags: " . join(", ", @{$c-&gt;access_flags}) . "\n";&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;interfaces&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns an array reference of the interfaces defined in the classfile. Currently unimplemented:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;my $interfaces = $c-&gt;interfaces;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;fields&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns an array reference of the fields defined in the classfile. Currently unimplemented:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;my $fields = $c-&gt;fields;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;methods&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method returns an array reference of the methods defined in the classfile:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;my $methods = $c-&gt;methods;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Each Java method is represented by an object which has the following methods: name, descriptor, access_flags and attributes. name and descriptor return the method name and descriptor. Possible access flags are:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;abstract&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared abstract; no implementation is provided&lt;br /&gt;&lt;b&gt;final&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared final; may not be overridden&lt;br /&gt;&lt;b&gt;native&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared native; implemented in a language other than Java&lt;br /&gt;&lt;b&gt;private&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared private; accessible only within the defining class&lt;br /&gt;&lt;b&gt;protected&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared protected; may be accessed within subclasses&lt;br /&gt;&lt;b&gt;public&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared public; may be accessed from outside its package&lt;br /&gt;&lt;b&gt;static&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared static&lt;br /&gt;strict&lt;br /&gt;&lt;br /&gt;    Declared strictfp; floating-point mode is FP-strict&lt;br /&gt;&lt;b&gt;synchronized&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    Declared synchronized; invocation is wrapped in a monitor lock&lt;br /&gt;&lt;br /&gt;Various attributes are possible, the most common being the Code attribute, where the value holds information about the Java bytecode for the method:&lt;br /&gt;&lt;br /&gt;&lt;DIV STYLE="overflow: auto; width: 420px; height: 200px; background-color: #CCCCCC;"&gt;&lt;br /&gt;  &lt;center&gt;foreach my $method (@{$c-&gt;methods}) {&lt;br /&gt;    print "  " . $method-&gt;name . " " . $method-&gt;descriptor;&lt;br /&gt;    print "\n    ";&lt;br /&gt;    print "is " . join(", ", @{$method-&gt;access_flags});&lt;br /&gt;    print "\n    ";&lt;br /&gt;    print "has attributes: ";&lt;br /&gt;    foreach my $att (@{$method-&gt;attributes}) {&lt;br /&gt;      my $name = $att-&gt;name;&lt;br /&gt;      my $value = $att-&gt;value;&lt;br /&gt;      if ($att-&gt;name eq 'Code') {&lt;br /&gt;        print "      $name: ";&lt;br /&gt;        print "stack(" . $value-&gt;max_stack . ")";&lt;br /&gt;        print ", locals(" . $value-&gt;max_locals . ")\n";&lt;br /&gt;        foreach my $instruction (@{$value-&gt;code}) {&lt;br /&gt;          print $instruction-&gt;label . ':' if defined $instruction-&gt;label;&lt;br /&gt;          print "\t" . $instruction-&gt;op . "\t" . (join ", ", @{$instruction-&gt;args}) . "\n";&lt;br /&gt;        }&lt;br /&gt;        print "\n";&lt;br /&gt;        foreach my $att2 (@{$value-&gt;attributes}) {&lt;br /&gt;          my $name2 = $att2-&gt;name;&lt;br /&gt;          my $value2 = $att2-&gt;value;&lt;br /&gt;          if ($name2 eq 'LineNumberTable') {&lt;br /&gt;            print "\tLineNumberTable (offset, line)\n";&lt;br /&gt;            print "\t" . $_-&gt;offset . ", " . $_-&gt;line . "\n" foreach (@$value2);&lt;br /&gt;          } else {&lt;br /&gt;            print "!\t$name2 = $value2\n";&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      } else {&lt;br /&gt;        print "!\t$name $value\n";&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    print "\n";&lt;br /&gt;  }&lt;/center&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Note that in the case of the Code attribute, the value contains an object which has three main methods: max_stack (the maximum depth of stack needed by the method), max_locals (the number of local variables used by the method), code (returns an arrayref of instruction objects which have op, args and label methods), and attributes. One attribute that Code can have is the LineNumberTable attributes, which has an arrayref of objects as a value. These have offset and line methods, representing a link between bytecode offset and sourcecode line.&lt;br /&gt;attributes&lt;br /&gt;&lt;br /&gt;This method returns an array reference of the attributes defined in the classfile. Attributes are common in many places in the classfile - here in particular we have the classfile attributes.&lt;br /&gt;&lt;br /&gt;   &lt;font color="#660033" size="2"&gt;my $attributes = $c-&gt;attributes;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Attributes are represented by an object that has name and value methods:&lt;br /&gt;&lt;br /&gt;  &lt;font color="#660033" size="2"&gt;foreach my $attribute (@{$c-&gt;attributes}) {&lt;br /&gt;    print "  " . $attribute-&gt;name . " = " . $attribute-&gt;value . "\n";&lt;/font&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Possible attributes include the SourceFile attribute, the value of which is the source file that was compiled into this classfile.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2894591406829007983?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2894591406829007983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2894591406829007983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2894591406829007983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2894591406829007983'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/defining-jvmjava-virtual-machine.html' title='Defining JVM(Java Virtual Machine)'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7840297966309746734</id><published>2008-08-15T23:52:00.000-07:00</published><updated>2008-08-15T23:57:20.346-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='interrupted execeptions'/><title type='text'>Java theory and practice: Dealing with InterruptedException</title><content type='html'>Many Java™ language methods, such as Thread.sleep() and Object.wait(), throw InterruptedException. You can't ignore it because it's a checked exception, but what should you do with it? In this month's Java theory and practice, concurrency expert Brian Goetz explains what InterruptedException means, why it is thrown, and what you should do when you catch one.&lt;br /&gt;&lt;br /&gt;This story is probably familiar: You're writing a test program and you need to pause for some amount of time, so you call Thread.sleep(). But then the compiler or IDE balks that you haven't dealt with the checked InterruptedException. What is InterruptedException, and why do you have to deal with it?&lt;br /&gt;&lt;br /&gt;The most common response to InterruptedException is to swallow it -- catch it and do nothing (or perhaps log it, which isn't any better) -- as we'll see later in Listing 4. Unfortunately, this approach throws away important information about the fact that an interrupt occurred, which could compromise the application's ability to cancel activities or shut down in a timely manner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Blocking methods&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When a method throws InterruptedException, it is telling you several things in addition to the fact that it can throw a particular checked exception. It is telling you that it is a blocking method and that it will make an attempt to unblock and return early -- if you ask nicely.&lt;br /&gt;A blocking method is different from an ordinary method that just takes a long time to run. The completion of an ordinary method is dependent only on how much work you've asked it to do and whether adequate computing resources (CPU cycles and memory) are available. The completion of a blocking method, on the other hand, is also dependent on some external event, such as timer expiration, I/O completion, or the action of another thread (releasing a lock, setting a flag, or placing a task on a work queue). Ordinary methods complete as soon as their work can be done, but blocking methods are less predictable because they depend on external events. Blocking methods can compromise responsiveness because it can be hard to predict when they will complete.&lt;br /&gt;&lt;br /&gt;Because blocking methods can potentially take forever if the event they are waiting for never occurs, it is often useful for blocking operations to be cancelable. (It is often useful for long-running non-blocking methods to be cancelable as well.) A cancelable operation is one that can be externally moved to completion in advance of when it would ordinarily complete on its own. The interruption mechanism provided by Thread and supported by Thread.sleep() and Object.wait() is a cancellation mechanism; it allows one thread to request that another thread stop what it is doing early. When a method throws InterruptedException, it is telling you that if the thread executing the method is interrupted, it will make an attempt to stop what it is doing and return early and indicate its early return by throwing InterruptedException. Well-behaved blocking library methods should be responsive to interruption and throw InterruptedException so they can be used within cancelable activities without compromising responsiveness.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Thread interruption&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Every thread has a Boolean property associated with it that represents its interrupted status. The interrupted status is initially false; when a thread is interrupted by some other thread through a call to Thread.interrupt(), one of two things happens. If that thread is executing a low-level interruptible blocking method like Thread.sleep(), Thread.join(), or Object.wait(), it unblocks and throws InterruptedException. Otherwise, interrupt() merely sets the thread's interruption status. Code running in the interrupted thread can later poll the interrupted status to see if it has been requested to stop what it is doing; the interrupted status can be read with Thread.isInterrupted() and can be read and cleared in a single operation with the poorly named Thread.interrupted().&lt;br /&gt;&lt;br /&gt;Interruption is a cooperative mechanism. When one thread interrupts another, the interrupted thread does not necessarily stop what it is doing immediately. Instead, interruption is a way of politely asking another thread to stop what it is doing if it wants to, at its convenience. Some methods, like Thread.sleep(), take this request seriously, but methods are not required to pay attention to interruption. Methods that do not block but that still may take a long time to execute can respect requests for interruption by polling the interrupted status and return early if interrupted. You are free to ignore an interruption request, but doing so may compromise responsiveness.&lt;br /&gt;&lt;br /&gt;One of the benefits of the cooperative nature of interruption is that it provides more flexibility for safely constructing cancelable activities. We rarely want an activity to stop immediately; program data structures could be left in an inconsistent state if the activity were canceled mid-update. Interruption allows a cancelable activity to clean up any work in progress, restore invariants, notify other activities of the cancellation, and then terminate.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Dealing with InterruptedException&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If throwing InterruptedException means that a method is a blocking method, then calling a blocking method means that your method is a blocking method too, and you should have a strategy for dealing with InterruptedException. Often the easiest strategy is to throw InterruptedException yourself, as shown in the putTask() and getTask() methods in Listing 1. Doing so makes your method responsive to interruption as well and often requires nothing more than adding InterruptedException to your throws clause.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Listing 1. Propagating InterruptedException to callers by not catching it&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class TaskQueue {&lt;br /&gt;    private static final int MAX_TASKS = 1000;&lt;br /&gt;&lt;br /&gt;    private BlockingQueue&lt;task&gt; queue&lt;br /&gt;        = new LinkedBlockingQueue&lt;task&gt;(MAX_TASKS);&lt;br /&gt;&lt;br /&gt;    public void putTask(Task r) throws InterruptedException {&lt;br /&gt;        queue.put(r);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Task getTask() throws InterruptedException {&lt;br /&gt;        return queue.take();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sometimes it is necessary to do some amount of cleanup before propagating the exception. In this case, you can catch InterruptedException, perform the cleanup, and then rethrow the exception. Listing 2, a mechanism for matching players in an online game service, illustrates this technique. The matchPlayers() method waits for two players to arrive and then starts a new game. If it is interrupted after one player has arrived but before the second player arrives, it puts that player back on the queue before rethrowing the InterruptedException, so that the player's request to play is not lost.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Listing 2. Performing task-specific cleanup before rethrowing InterruptedException&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class PlayerMatcher {&lt;br /&gt;    private PlayerSource players;&lt;br /&gt;&lt;br /&gt;    public PlayerMatcher(PlayerSource players) {&lt;br /&gt;        this.players = players;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void matchPlayers() throws InterruptedException {&lt;br /&gt;        Player playerOne, playerTwo;&lt;br /&gt;         try {&lt;br /&gt;             while (true) {&lt;br /&gt;                 playerOne = playerTwo = null;&lt;br /&gt;                 // Wait for two players to arrive and start a new game&lt;br /&gt;                 playerOne = players.waitForPlayer(); // could throw IE&lt;br /&gt;                 playerTwo = players.waitForPlayer(); // could throw IE&lt;br /&gt;                 startNewGame(playerOne, playerTwo);&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;         catch (InterruptedException e) { &lt;br /&gt;             // If we got one player and were interrupted, put that player back&lt;br /&gt;             if (playerOne != null)&lt;br /&gt;                 players.addFirst(playerOne);&lt;br /&gt;             // Then propagate the exception&lt;br /&gt;             throw e;&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Don't swallow interrupts&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sometimes throwing InterruptedException is not an option, such as when a task defined by Runnable calls an interruptible method. In this case, you can't rethrow InterruptedException, but you also do not want to do nothing. When a blocking method detects interruption and throws InterruptedException, it clears the interrupted status. If you catch InterruptedException but cannot rethrow it, you should preserve evidence that the interruption occurred so that code higher up on the call stack can learn of the interruption and respond to it if it wants to. This task is accomplished by calling interrupt() to "reinterrupt" the current thread, as shown in Listing 3. At the very least, whenever you catch InterruptedException and don't rethrow it, reinterrupt the current thread before returning.&lt;br /&gt;&lt;br /&gt;Listing 3. Restoring the interrupted status after catching InterruptedException&lt;br /&gt;&lt;br /&gt;public class TaskRunner implements Runnable {&lt;br /&gt;    private BlockingQueue&lt;task&gt; queue;&lt;br /&gt;&lt;br /&gt;    public TaskRunner(BlockingQueue&lt;task&gt; queue) {&lt;br /&gt;        this.queue = queue;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run() {&lt;br /&gt;        try {&lt;br /&gt;             while (true) {&lt;br /&gt;                 Task task = queue.take(10, TimeUnit.SECONDS);&lt;br /&gt;                 task.execute();&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;         catch (InterruptedException e) {&lt;br /&gt;             // Restore the interrupted status&lt;br /&gt;             Thread.currentThread().interrupt();&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The worst thing you can do with InterruptedException is swallow it -- catch it and neither rethrow it nor reassert the thread's interrupted status. The standard approach to dealing with an exception you didn't plan for -- catch it and log it -- also counts as swallowing the interruption because code higher up on the call stack won't be able to find out about it. (Logging InterruptedException is also just silly because by the time a human reads the log, it is too late to do anything about it.) Listing 4 shows the all-too-common pattern of swallowing an interrupt:&lt;br /&gt;&lt;br /&gt;Listing 4. Swallowing an interrupt -- don't do this&lt;br /&gt;&lt;br /&gt;// Don't do this&lt;br /&gt;public class TaskRunner implements Runnable {&lt;br /&gt;    private BlockingQueue&lt;task&gt; queue;&lt;br /&gt;&lt;br /&gt;    public TaskRunner(BlockingQueue&lt;task&gt; queue) {&lt;br /&gt;        this.queue = queue;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run() {&lt;br /&gt;        try {&lt;br /&gt;             while (true) {&lt;br /&gt;                 Task task = queue.take(10, TimeUnit.SECONDS);&lt;br /&gt;                 task.execute();&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;         catch (InterruptedException swallowed) {&lt;br /&gt;             /* DON'T DO THIS - RESTORE THE INTERRUPTED STATUS INSTEAD */&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you cannot rethrow InterruptedException, whether or not you plan to act on the interrupt request, you still want to reinterrupt the current thread because a single interruption request may have multiple "recipients." The standard thread pool (ThreadPoolExecutor) worker thread implementation is responsive to interruption, so interrupting a task running in a thread pool may have the effect of both canceling the task and notifying the execution thread that the thread pool is shutting down. If the task were to swallow the interrupt request, the worker thread might not learn that an interrupt was requested, which could delay the application or service shutdown.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Back to top&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Implementing cancelable tasks&lt;br /&gt;&lt;br /&gt;Nothing in the language specification gives interruption any specific semantics, but in larger programs, it is difficult to maintain any semantics for interruption other than cancellation. Depending on the activity, a user could request cancellation through a GUI or through a network mechanism such as JMX or Web Services. It could also be requested by program logic. For example, a Web crawler might automatically shut itself down if it detects that the disk is full, or a parallel algorithm might start multiple threads to search different regions of the solution space and cancel them once one of them finds a solution.&lt;br /&gt;&lt;br /&gt;Just because a task is cancelable does not mean it needs to respond to an interrupt request immediately. For tasks that execute code in a loop, it is common to check for interruption only once per loop iteration. Depending on how long the loop takes to execute, it could take some time before the task code notices the thread has been interrupted (either by polling the interrupted status with Thread.isInterrupted() or by calling a blocking method). If the task needs to be more responsive, it can poll the interrupted status more frequently. Blocking methods usually poll the interrupted status immediately on entry, throwing InterruptedException if it is set to improve responsiveness.&lt;br /&gt;&lt;br /&gt;The one time it is acceptable to swallow an interrupt is when you know the thread is about to exit. This scenario only occurs when the class calling the interruptible method is part of a Thread, not a Runnable or general-purpose library code, as illustrated in Listing 5. It creates a thread that enumerates prime numbers until it is interrupted and allows the thread to exit upon interruption. The prime-seeking loop checks for interruption in two places: once by polling the isInterrupted() method in the header of the while loop and once when it calls the blocking BlockingQueue.put() method.&lt;br /&gt;&lt;br /&gt;Listing 5. Interrupts can be swallowed if you know the thread is about to exit&lt;br /&gt;&lt;br /&gt;public class PrimeProducer extends Thread {&lt;br /&gt;    private final BlockingQueue&lt;biginteger&gt; queue;&lt;br /&gt;&lt;br /&gt;    PrimeProducer(BlockingQueue&lt;biginteger&gt; queue) {&lt;br /&gt;        this.queue = queue;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run() {&lt;br /&gt;        try {&lt;br /&gt;            BigInteger p = BigInteger.ONE;&lt;br /&gt;            while (!Thread.currentThread().isInterrupted())&lt;br /&gt;                queue.put(p = p.nextProbablePrime());&lt;br /&gt;        } catch (InterruptedException consumed) {&lt;br /&gt;            /* Allow thread to exit */&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void cancel() { interrupt(); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Noninterruptible blocking&lt;br /&gt;&lt;br /&gt;Not all blocking methods throw InterruptedException. The input and output stream classes may block waiting for an I/O to complete, but they do not throw InterruptedException, and they do not return early if they are interrupted. However, in the case of socket I/O, if a thread closes the socket, blocking I/O operations on that socket in other threads will complete early with a SocketException. The nonblocking I/O classes in java.nio also do not support interruptible I/O, but blocking operations can similarly be canceled by closing the channel or requesting a wakeup on the Selector. Similarly, attempting to acquire an intrinsic lock (enter a synchronized block) cannot be interrupted, but ReentrantLock supports an interruptible acquisition mode.&lt;br /&gt;&lt;br /&gt;Noncancelable tasks&lt;br /&gt;&lt;br /&gt;Some tasks simply refuse to be interrupted, making them noncancelable. However, even noncancelable tasks should attempt to preserve the interrupted status in case code higher up on the call stack wants to act on the interruption after the noncancelable task completes. Listing 6 shows a method that waits on a blocking queue until an item is available, regardless of whether it is interrupted. To be a good citizen, it restores the interrupted status in a finally block after it is finished, so as not to deprive callers of the interruption request. (It can't restore the interrupted status earlier, as it would cause an infinite loop -- BlockingQueue.take() could poll the interrupted status immediately on entry and throws InterruptedException if it finds the interrupted status set.)&lt;br /&gt;&lt;br /&gt;Listing 6. Noncancelable task that restores interrupted status before returning&lt;br /&gt;&lt;br /&gt;public Task getNextTask(BlockingQueue&lt;task&gt; queue) {&lt;br /&gt;    boolean interrupted = false;&lt;br /&gt;    try {&lt;br /&gt;        while (true) {&lt;br /&gt;            try {&lt;br /&gt;                return queue.take();&lt;br /&gt;            } catch (InterruptedException e) {&lt;br /&gt;                interrupted = true;&lt;br /&gt;                // fall through and retry&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    } finally {&lt;br /&gt;        if (interrupted)&lt;br /&gt;            Thread.currentThread().interrupt();&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7840297966309746734?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7840297966309746734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7840297966309746734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7840297966309746734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7840297966309746734'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2008/08/java-theory-and-practice-dealing-with.html' title='Java theory and practice: Dealing with InterruptedException'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7938489929720868393</id><published>2007-11-12T08:25:00.000-08:00</published><updated>2007-11-12T08:28:04.070-08:00</updated><title type='text'>Goalsof JAVA-JDBC</title><content type='html'>The JDBC API is a mature technology, having first been specified in January 1997. In&lt;br /&gt;its initial release, the JDBC API focused on providing a basic call-level interface to&lt;br /&gt;SQL databases. The JDBC 2.1 specification and the 2.0 Optional Package&lt;br /&gt;specification then broadened the scope of the API to include support for more&lt;br /&gt;advanced applications and for the features required by application servers to&lt;br /&gt;manage use of the JDBC API on behalf of their applications.&lt;br /&gt;The overall goal of the JDBC 3.0 specification is to “round out” the API by filling in&lt;br /&gt;smaller areas of missing functionality. The following list outlines the goals and&lt;br /&gt;design philosophy for the JDBC API in general and the JDBC 3.0 API in particular:&lt;br /&gt;1. Fit into the J2EE and J2SE platforms&lt;br /&gt;The JDBC API is a constituent technology of the Java platform. The JDBC 3.0 API&lt;br /&gt;should be aligned with the overall direction of the Java 2 Enterprise Edition and&lt;br /&gt;Java 2 Standard Edition platforms.&lt;br /&gt;2. Be consistent with SQL99&lt;br /&gt;The JDBC API provides programmatic access from applications written in the&lt;br /&gt;Java programming language to standard SQL. At the time the JDBC 2.0 API was&lt;br /&gt;in development, the SQL99 specification was a moving target. SQL99 is now a&lt;br /&gt;published standard and includes features that are widely supported among&lt;br /&gt;DBMS vendors as well as features that only a few vendors support. The intent of&lt;br /&gt;the JDBC 3.0 API is to provide access to the subset of SQL99 features that are&lt;br /&gt;likely to be widely supported within the next five years.&lt;br /&gt;3. Consolidate predecessor specifications&lt;br /&gt;This document incorporates content from three prior JDBC specifications to&lt;br /&gt;provide a single standalone specification of the JDBC API.&lt;br /&gt;4. Offer vendor-neutral access to common features&lt;br /&gt;The JDBC API strives to provide high-bandwidth access to features commonly&lt;br /&gt;supported across different vendor implementations. The goal is to provide a&lt;br /&gt;degree of feature access comparable to what can be achieved by native&lt;br /&gt;applications. However, the API must be general and flexible enough to allow for&lt;br /&gt;a wide range of implementations.&lt;br /&gt;5. Maintain the focus on SQL&lt;br /&gt;The focus of the JDBC API has always been on accessing relational data from the&lt;br /&gt;Java programming language. This continues to be true with the JDBC 3.0 API. The&lt;br /&gt;JDBC 3.0 API does not preclude interacting with other technologies, including&lt;br /&gt;XML, CORBA, or non-relational data, but the primary target will still be relational&lt;br /&gt;data and SQL.&lt;br /&gt;6. Provide a foundation for tools and higher-level APIs&lt;br /&gt;The JDBC API presents a standard API to access a wide range of underlying data&lt;br /&gt;sources or legacy systems. Implementation differences are made transparent&lt;br /&gt;through JDBC API abstractions, making it a valuable target platform for tools&lt;br /&gt;vendors who want to create portable tools and applications.&lt;br /&gt;Because it is a “call-level” interface from the Java programming language to SQL,&lt;br /&gt;the JDBC API is also suitable as a base layer for higher-level facilities such as EJB&lt;br /&gt;2.0 container-managed persistence and SQLJ.&lt;br /&gt;7. Keep it simple&lt;br /&gt;The JDBC API is intended to be a simple-to-use, straightforward interface upon&lt;br /&gt;which more complex entities can be built. This goal is achieved by defining many&lt;br /&gt;compact, single-purpose methods instead of a smaller number of complex, multipurpose&lt;br /&gt;ones with control flag parameters.&lt;br /&gt;8. Enhance reliability, availability, and scalability&lt;br /&gt;Reliability, availability, and scalability are the themes of the J2EE and J2SE&lt;br /&gt;platforms, as well as the direction for future Java platforms. The JDBC 3.0 API&lt;br /&gt;stays true to these themes by enhancing support in several areas, including&lt;br /&gt;resource management, the reuse of prepared statements across logical&lt;br /&gt;connections, and error handling.&lt;br /&gt;9. Maintain backward compatibility with existing applications and drivers&lt;br /&gt;Existing JDBC technology-enabled drivers (“JDBC drivers”) and the applications&lt;br /&gt;that use them must continue to work in an implementation of the Java virtual&lt;br /&gt;machine that supports the JDBC 3.0 API. Applications that use only features&lt;br /&gt;defined in earlier releases of the JDBC API, excluding those that were deprecated&lt;br /&gt;by JDBC 2.0, will not require changes to continue running. It should be&lt;br /&gt;straightforward for existing applications to migrate to JDBC 3.0 technology.&lt;br /&gt;10. Allow forward compatibility with Connectors&lt;br /&gt;The Connector architecture defines a standard way to package and deploy a&lt;br /&gt;resource adapter that allows a J2EE container to integrate its connection,&lt;br /&gt;transaction, and security management with those of an external resource.&lt;br /&gt;The JDBC 3.0 API provides the migration path for JDBC drivers to the Connector&lt;br /&gt;architecture. It should be possible for vendors whose products use JDBC&lt;br /&gt;technology to move incrementally towards implementing the Connector API. The&lt;br /&gt;expectation is that these implementors will write “resource manager wrappers”&lt;br /&gt;around their existing data source implementations so that they can be reused in a&lt;br /&gt;Connector framework.&lt;br /&gt;11. Specify requirements unambiguously&lt;br /&gt;The requirements for JDBC compliance need to be unambiguous and easy to&lt;br /&gt;identify. The JDBC 3.0 specification and the API documentation (Javadoc) will&lt;br /&gt;clarify which features are required and which are optional.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7938489929720868393?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7938489929720868393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7938489929720868393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7938489929720868393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7938489929720868393'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/goalsof-java-jdbc.html' title='Goalsof JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-825763003257039437</id><published>2007-11-12T08:12:00.000-08:00</published><updated>2007-11-12T08:28:58.777-08:00</updated><title type='text'>Overview of JAVA-JDBC</title><content type='html'>The JDBC API provides a way for Java programs to access one or more sources of&lt;br /&gt;data. In the majority of cases, the data source is a relational DBMS, and its data is accessed using SQL. However, it is also possible for JDBC technology-enabled drivers to be implemented on top of other data sources, including legacy file systems and object-oriented systems. A primary motivation for the JDBC API is to provide a standard API for applications to access a wide variety of data sources. This chapter introduces some of the key concepts of the JDBC API. In addition, it describes two common environments for JDBC applications, with a discussion of&lt;br /&gt;how different functional roles are implemented in each one. The two-tier and three-tier models are logical configurations that can be implemented on a variety of  physical configurations.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Establishing a Connection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The JDBC API defines the Connection interface to represent a connection to an underlying data source. In a typical scenario, a JDBC application will connect to a target data source using&lt;br /&gt;one of two mechanisms:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;DriverManager — this fully implemented class was introduced in the original JDBC 1.0 API and requires the application to load a specific driver using a hardcoded URL.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;DataSource — this interface was introduced in the JDBC 2.0 Optional Package API. It is preferred over DriverManager because it allows details about the underlying data source to be transparent to the application. A DataSource object’s properties are set so that it represents a particular data source. When its getConnection method is invoked, the DataSource instance will return a connection to that data source. An application can be directed to a different data source by simply changing the DataSource object’s properties; no change in application code is needed. Likewise, a DataSource implementation can be changed without changing the application code that uses it. The JDBC API also defines two important extensions of the DataSource interface tosupport enterprise applications. These extensions are the following two interfaces:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;ConnectionPoolDataSource — supports caching and reusing of physical connections, which improves application performance and scalability&lt;/li&gt;&lt;li&gt;XADataSource — provides connections that can participate in a distributed transaction&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Executing SQL Statements and&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Manipulating Results&lt;br /&gt;&lt;br /&gt;Once a connection has been established, an application using the JDBC API can execute queries and updates against the target data source. The JDBC 3.0 API provides access to the most commonly implemented features of SQL99. Because different vendors vary in their level of support for these features, the JDBC API includes the DatabaseMetadata interface. Applications can use this interface to determine whether a particular feature is supported by the data source they are using. The JDBC API also defines escape syntax to allow an application to access non-standard vendor-specific features. The use of escape syntax has the advantage&lt;br /&gt;of giving JDBC applications access to the same feature set as native applications and at the same time maintaining the portability of the application. Applications use methods in the Connection interface to specify transaction attributes and create Statement, PreparedStatement, or CallableStatement objects. These statements are used to execute SQL statements and retrieve results. The ResultSet interface encapsulates the results of an SQL query. Statements may&lt;br /&gt;also be batched, allowing an application to submit multiple updates to a data source&lt;br /&gt;as a single unit of execution. The JDBC API extends the ResultSet interface with the RowSet interface, thereby providing a container for tabular data that is much more versatile than a standard result set. A RowSet object is a JavaBeansTM component, and it may operate without&lt;br /&gt;being connected to its data source. For example, a RowSet implementation can be serializable and therefore sent across a network, which is particularly useful for small-footprint clients that want to operate on tabular data without incurring the overhead of a JDBC driver and data source connection. Another feature of a RowSet implementation is that it can include a custom reader for accessing any data in tabular format, not just data in a relational database. Further, a RowSet object can  update its rows while it is disconnected from its data source, and its implementation can include a custom writer that writes those updates back to the underlying data source.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Support for SQL Advanced Data Types&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The JDBC API defines standard mappings to convert SQL data types to JDBC data types and back. This includes support for SQL99 advanced data types such as BLOB, CLOB, ARRAY, REF, STRUCT, and DISTINCT. JDBC drivers may also implement one or more customized type mappings for user-defined types (UDTs), in which the UDT is mapped to a class in the Java programming language. The JDBC 3.0 API also adds support for externally managed data, for example, data in a file outside the data source.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Two-tier Model&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A two-tier model divides functionality into a client layer and a server layer&lt;br /&gt;The client layer includes the application(s) and one or more JDBC drivers, with the&lt;br /&gt;application handling these areas of responsibility:&lt;br /&gt;&lt;br /&gt;Application&lt;br /&gt;data source&lt;br /&gt;JDBC Driver&lt;br /&gt;&lt;ul&gt;&lt;li&gt;presentation logic&lt;/li&gt;&lt;li&gt;business logic&lt;/li&gt;&lt;li&gt;transaction management for multiple-statement transactions or distributed transactions&lt;/li&gt;&lt;li&gt;resource management&lt;/li&gt;&lt;/ul&gt;In this model, the application interacts directly with the JDBC driver(s), including establishing and managing the physical connection(s) and dealing with the details of specific underlying data source implementations. The application may use its knowledge of a specific implementation to take advantage of nonstandard features or do performance tuning.&lt;br /&gt;Some drawbacks of this model include:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;mingling presentation and business logic with infrastructure and system-level functions. This presents an obstacle to producing maintainable code with a welldefined architecture.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;making applications less portable because they are tuned to a particular database implementation. Applications that require connections to multiple databases must be aware of the differences between the different vendors’ implementations.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;limiting scalability. Typically, the application will hold onto one or more physical database connections until it terminates, limiting the number of concurrent applications that can be supported. In this model, issues of performance, scalability and availability are handled by the JDBC driver and the corresponding underlying data source. If an application deals with multiple drivers, it may also need to be aware of the different ways in which each driver/data source pair resolves these issues.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Three-tier Model&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The three-tier model introduces a middle-tier server to house business logic and&lt;br /&gt;infrastructure. This architecture is designed to provide improved performance, scalability and&lt;br /&gt;availability for enterprise applications. Functionality is divided among the tiers as follows:&lt;br /&gt;&lt;br /&gt;1. Client tier — a thin layer implementing presentation logic for human interaction.&lt;br /&gt;Java programs, web browsers and PDAs are typical client-tier implementations.&lt;br /&gt;The client interacts with the middle-tier application and does not need to include&lt;br /&gt;any knowledge of infrastructure or underlying data source functions.&lt;br /&gt;2. Middle-tier server — a middle tier that includes:&lt;br /&gt;n Applications to interact with the client and implement business logic. If the&lt;br /&gt;application includes interaction with a data source, it will deal with higherlevel&lt;br /&gt;abstractions, such as DataSource objects and logical connections rather&lt;br /&gt;than lower-level driver API.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;data source&lt;br /&gt;Web Client&lt;br /&gt;(Browser) Application&lt;br /&gt;Server&lt;br /&gt;transaction&lt;br /&gt;manager&lt;br /&gt;JDBC&lt;br /&gt;Driver&lt;br /&gt;JDBC&lt;br /&gt;Driver&lt;br /&gt;data source&lt;br /&gt;Middle-tier Server&lt;br /&gt;Application Application&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An application server to provide supporting infrastructure for a wide range ofapplications. This can include management and pooling of physical connections, transaction management, and the masking of differences between different JDBC drivers. This last point makes it easier to write portable applications. The application server role can be implemented by a J2EE server. Application servers implement the higher-level abstractions used by applications and interact directly with JDBC drivers.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;JDBC driver(s) to provide connectivity to the underlying data sources. Each driver implements the standard JDBC API on top of whatever features are supported by its underlying data source. The driver layer may mask differences between standard SQL99 syntax and the native dialect supported by the data source. If the data source is not a relational DBMS, the driver implements the relational layer used by the application server.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;3. Underlying data source — the tier where the data resides. It can include&lt;br /&gt;relational DBMSs, legacy file systems, object-oriented DBMSs, data warehouses,&lt;br /&gt;spreadsheets, or other means of packaging and presenting data. The only&lt;br /&gt;requirement is a corresponding driver that supports the JDBC API.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;JDBC in the J2EE Platform&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;J2EE components, such as JavaServerTM Pages, Servlets, and Enterprise Java BeansTM&lt;br /&gt;(EJBTM) components, often require access to relational data and use the JDBC API for this access. When J2EE components use the JDBC API, the container manages their transactions and data sources. This means that J2EE component developers do not directly use the JDBC API’s transaction and datasource management facilities. See the J2EE Platform Specification for further details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-825763003257039437?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/825763003257039437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=825763003257039437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/825763003257039437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/825763003257039437'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/overview-of-java.html' title='Overview of JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7630512522311621869</id><published>2007-11-12T08:06:00.000-08:00</published><updated>2007-11-12T08:29:53.604-08:00</updated><title type='text'>Classes and Interfaces in JAVA-JDBC</title><content type='html'>The following classes and interfaces make up the JDBC API.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;The java.sql Package&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The core JDBC API is contained in the package java.sql. The classes and interfaces&lt;br /&gt;in java.sql are listed below. Classes are bold type; interfaces are in standard type.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Array&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.BatchUpdateException&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Blob&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.CallableStatement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Clob&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Connection&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DataTruncation&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DatabaseMetaData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Driver&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DriverManager&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DriverPropertyInfo&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ParameterMetaData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.PreparedStatement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Ref&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSet&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSetMetaData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Chapter 5 Classes and Interfaces 30&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Savepoint&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLException&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLInput&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLOutput&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLPermission&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLWarning&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Statement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Struct&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Timestamp&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Types&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;The following classes and interfaces are either new or updated in the JDBC 3.0 API.&lt;br /&gt;New classes and interfaces are highlighted in bold.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Array&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Blob&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.CallableStatement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Clob&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Connection&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DatabaseMetaData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ParameterMetaData&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.PreparedStatement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Ref&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Java.sql.ResultSet&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Savepoint&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.SQLInput&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sqlOutput&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Statement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Types&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Relationships between major classes and interface in the java.sql package&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Connection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Statement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Data types&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CallableStatement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ResultSet&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;PreparedStatement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;subclasses&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;prepareStatement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;prepareCall&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;createStatement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;executeQuery&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;executeQuery&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;executeQuery&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Input to&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;getXXX&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Input/Output of&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;getMoreResults / getResultSet&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;subclasses&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;PreparedStatement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CallableStatement&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;br /&gt;The javax.sql Package&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The following list contains the classes and interfaces that are contained in the&lt;br /&gt;javax.sql package. Classes are highlighted in bold; interfaces are in normal type.&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.ConnectionEvent&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.ConnectionEventListener&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.ConnectionPoolDataSource&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.DataSource&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.PooledConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSet&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetEvent&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetInternal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetListener&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetMetaData&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetReader&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.RowSetWriter&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.XAConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql.XADataSource&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Note – The classes and interfaces in the javax.sql package were first made available as the JDBC 2.0 Optional Package. This optional package was previously separate from the java.sql package, which was part of J2SE 1.2. Both packages (java.sql and javax.sql) are now part of J2SE 1.4.&lt;br /&gt;&lt;br /&gt;classes and interfaces in these areas of functionality: DataSource objects, connection pooling, distributed transactions, and rowsets.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Relationship between javax.sql.DataSource and java.sql.Connection&lt;br /&gt;Relationships involved in connection pooling DataSource Connection&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;java.sql javax.sql&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;getConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Connection PooledConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;javax.sql java.sql&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;getConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ConnectionPoolDataSource&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;getConnection&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ConnectionEvent&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ConnectionEventListener&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;close or error event&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Relationships involved in distributed transaction support&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;XAConnection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PooledConnection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ConnectionEvent&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XAResource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ConnectionEventListener&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XADataSource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Connection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql javax.sql javax.transaction.xa&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;getConnection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;getXAConnection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;getXAResource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;subclasses&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;close or error event&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7630512522311621869?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7630512522311621869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7630512522311621869' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7630512522311621869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7630512522311621869'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/classes-and-interfaces-in-java.html' title='Classes and Interfaces in JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1966311143695222425</id><published>2007-11-12T07:57:00.000-08:00</published><updated>2007-11-12T08:30:07.613-08:00</updated><title type='text'>Compliance in JAVA-JDBC</title><content type='html'>This chapter identifies the features that a JDBC API implementation is required to support for each level of compliance. A JDBC API implementation includes a JDBC&lt;br /&gt;technology-enabled driver and its underlying data source. Therefore, compliance is defined in terms of what features are available above the driver layer. Any features not identified here are optional. In general, a driver is not required to implement any feature that its underlying data source does not support.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt; Definitions&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;To avoid ambiguity, we will use these terms in our discussion of compliance:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;JDBC API implementation — a JDBC technology-enabled driver and its underlying data source. The driver may provide support for features that are not implemented by the underlying data source. It may also provide the mapping between standard syntax/semantics and the native API implemented by the data source.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Relevant specifications — this document, the API specification, and the relevant SQL specification. This is also the order of precedence if a feature is described in more than one of these documents. For the JDBC 1.0 API, the relevant SQL specification is SQL92 and X/Open SQL CLI. For the JDBC 2.0 and 3.0 APIs, it is SQL92 plus the relevant sections of SQL99 and X/Open SQL CLI.&lt;/li&gt;&lt;li&gt;Supported feature — a feature for which the JDBC API implementation supports standard syntax and semantics for that feature as defined in the relevant specifications.&lt;/li&gt;&lt;li&gt;Extension — a feature that is not covered by any of the relevant specifications or a non-standard implementation of a feature that is covered.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Fully implemented — a term applied to an interface that has all of its methods implemented to support the semantics defined in the relevant specifications.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Required interface — an interface that must be included although it might not be fully implemented. Methods that are not implemented should throw an SQLException to indicate that the corresponding feature is not supported.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Guidelines and Requirements&lt;/span&gt;&lt;br /&gt;The following guidelines apply to all levels of compliance:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A JDBC API implementation must support Entry Level SQL92 plus the SQL command Drop Table (see note.)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Entry Level SQL92 represents a "floor" for the level of SQL that a JDBC API&lt;br /&gt;implementation must support. Access to features based on SQL99 should be&lt;br /&gt;provided in a way that is compatible with the relevant part of the SQL99&lt;br /&gt;specification.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Drivers must support escape syntax. Escape syntax is described in “Statements”.&lt;/li&gt;&lt;li&gt;Drivers must support transactions. See Chapter 10 “Transactions” for details.&lt;/li&gt;&lt;li&gt;Drivers should provide access to every feature implemented by the underlying data source, including features that extend the JDBC API. When a feature is not supported, the corresponding methods throw an SQLException. The intent is for applications using the JDBC API to have access to the same feature set as native applications.&lt;/li&gt;&lt;li&gt;If a DatabaseMetaData method indicates that a given feature is supported, it must be supported via standard syntax and semantics as described in the relevant specifications. This may require the driver to provide the mapping to the data source’s native API or SQL dialect if it differs from the standard.&lt;/li&gt;&lt;li&gt;If a feature is supported, all of the relevant metadata methods must be implemented. For example, if a JDBC API implementation supports the RowSet interface, it must also implement the RowSetMetaData interface.&lt;/li&gt;&lt;li&gt;If a feature is not supported, the corresponding DatabaseMetaData method must say so. Attempting to access the unsupported feature causes an SQLException to be thrown.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Note – A JDBC API implementation is required to support the DROP TABLE&lt;br /&gt;command as specified by SQL92, Transitional Level. However, support for the&lt;br /&gt;CASCADE and RESTRICT options of DROP TABLE is optional. In addition, the&lt;br /&gt;behaviour of DROP TABLE is implementation-defined when there are views or&lt;br /&gt;integrity constraints defined that reference the table being dropped.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;JDBC 1.0 API Compliance&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A driver that is compliant with the JDBC 1.0 API must do the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Adhere to the preceding guidelines and requirements&lt;/li&gt;&lt;li&gt;Fully implement the following interfaces:&lt;/li&gt;&lt;li&gt;java.sql.Driver&lt;/li&gt;&lt;li&gt;java.sql.DatabaseMetaData (excepting those methods introduced in the JDBC 2.0 API and the JDBC 3.0 API)&lt;/li&gt;&lt;li&gt;java.sql.ResultSetMetaData (excepting those methods introduced in the JDBC 2.0 API and the JDBC 3.0 API)&lt;/li&gt;&lt;li&gt;Include the following required interfaces:&lt;/li&gt;&lt;li&gt;java.sql.CallableStatement&lt;/li&gt;&lt;li&gt;java.sql.Connection&lt;/li&gt;&lt;li&gt;java.sql PreparedStatement&lt;/li&gt;&lt;li&gt;java.sql.ResultSet&lt;/li&gt;&lt;li&gt;java.sql.Statement&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;JDBC 2.0 API Compliance&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A driver that is compliant with the JDBC 2.0 API must do the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Comply with the JDBC 1.0 API requirements&lt;/li&gt;&lt;li&gt;Implement the following additional DatabaseMetaData methods:&lt;/li&gt;&lt;li&gt;deletesAreDetected&lt;/li&gt;&lt;li&gt;getConnection&lt;/li&gt;&lt;li&gt;getUDTs&lt;/li&gt;&lt;li&gt;insertsAreDetetced&lt;/li&gt;&lt;li&gt;othersDeletesAreVisible&lt;/li&gt;&lt;li&gt;othersInsertsAreVisible&lt;/li&gt;&lt;li&gt;othersUpdatesAreVisible&lt;/li&gt;&lt;li&gt;ownDeletesAreVisible&lt;/li&gt;&lt;li&gt;ownInsertsAreVisible&lt;/li&gt;&lt;li&gt;ownUpdatesAreVisible&lt;/li&gt;&lt;li&gt;supportsBatchUpdates&lt;/li&gt;&lt;li&gt;supportsResultSetConcurrency&lt;/li&gt;&lt;li&gt;supportsResultSetType&lt;/li&gt;&lt;li&gt;updatesAreDetected&lt;/li&gt;&lt;li&gt;Implement the following additional ResultSetMetaData methods:&lt;/li&gt;&lt;li&gt;getColumnClassName&lt;/li&gt;&lt;li&gt;getColumnType&lt;/li&gt;&lt;li&gt;getColumnTypeName&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;JDBC 3.0 API Compliance&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A driver that is compliant with the JDBC 3.0 API must do the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Comply with the JDBC 2.0 API requirements&lt;/li&gt;&lt;li&gt;Include the following required interfaces:&lt;/li&gt;&lt;li&gt;java.sql.ParameterMetaData&lt;/li&gt;&lt;li&gt;java.sql.Savepoint&lt;/li&gt;&lt;li&gt;It must implement the following additional DatabaseMetaData methods:&lt;/li&gt;&lt;li&gt;supportsSavepoints&lt;/li&gt;&lt;li&gt;supportsNamedParameters&lt;/li&gt;&lt;li&gt;supportsMultipleOpenResults&lt;/li&gt;&lt;li&gt;supportsGetGeneratedKeys&lt;/li&gt;&lt;li&gt;getSuperTypes&lt;/li&gt;&lt;li&gt;getSuperTables&lt;/li&gt;&lt;li&gt;getAttributes&lt;/li&gt;&lt;li&gt;getResultSetHoldability&lt;/li&gt;&lt;li&gt;supportsResultSetHoldability&lt;/li&gt;&lt;li&gt;getSQLStateType&lt;/li&gt;&lt;li&gt;getDatabaseMajorVersion&lt;/li&gt;&lt;li&gt;getDatabaseMinorVersion&lt;/li&gt;&lt;li&gt;getJDBCMajorVersion&lt;/li&gt;&lt;li&gt;getJDBCMinorVersion&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Determining Compliance Level&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The JDBC API is a constituent technology of the Java platform. Compliance with the&lt;br /&gt;JDBC API specification is determined as a subset of evaluating compliance with the&lt;br /&gt;overall platform.&lt;br /&gt;Note – As of this writing, there is no separate evaluation of compliance level for the JDBC API.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Deprecated APIs&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Deprecation refers to a class, interface, constructor, method or field that is no longer recommended and may cease to exist in a future version. The following constructors and methods were deprecated in the JDBC 2.0 API:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;java.sql.CallableStatement.getBigDecimal(int, int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date(int, int, int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.getHours()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.getMinutes()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.getSeconds()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.setHours(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.setMinutes(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Date.setSeconds(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DriverManager.getLogStream()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.DriverManager.setLogStream(PrintStream)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;java.sql.PreparedStatement.setUnicodeStream(int, InputStream,&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSet.getBigDecimal(int, int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSet.getBigDecimal(String, int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSet.getUnicodeStream(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.ResultSet.getUnicodeStream(String)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time(int, int, int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.getDate()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.getDay()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.getMonth()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.getYear()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.setDate(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.setMonth(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Time.setYear(int)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;java.sql.Timestamp(int, int, int, int, int, int, int)&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-1966311143695222425?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/1966311143695222425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=1966311143695222425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1966311143695222425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1966311143695222425'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/compliance-in-java.html' title='Compliance in JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-4664084701972196840</id><published>2007-11-12T07:47:00.000-08:00</published><updated>2007-11-12T07:57:11.140-08:00</updated><title type='text'>Database Metadata</title><content type='html'>The DatabaseMetaData interface is implemented by JDBC drivers to provide&lt;br /&gt;information about their underlying data sources. It is used primarily by application servers and tools to determine how to interact with a given data source. Applications may also use DatabaseMetaData methods to get information about a data source, but this is less typical.&lt;br /&gt;The DatabaseMetaData interface includes over 150 methods, which can be categorized according to the types of information they provide:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;general information about the data source&lt;/li&gt;&lt;li&gt;whether or not the data source supports a given feature or capability&lt;/li&gt;&lt;li&gt;data source limits&lt;/li&gt;&lt;li&gt;what SQL objects the data source contains and attributes of those objects&lt;/li&gt;&lt;li&gt;transaction support offered by the data source&lt;/li&gt;&lt;/ul&gt;The DatabaseMetaData interface also contains over 40 fields, which are constants used as return values for various DatabaseMetaData methods. This chapter presents an overview of the DatabaseMetaData interface, gives examples to illustrate the categories of metadata methods, and introduces some new methods. For a comprehensive listing, however, the reader should consult the JDBC&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;API specification.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;JDBC also defines the ResultSetMetaData interface, which is discussed in “Result Sets”.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Creating a DatabaseMetadata Object&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A DatabaseMetaData object is created with the Connection method getMetaData. Once created, it can be used to dynamically discover information about the underlying data source. CODE EXAMPLE       creates a DatabaseMetadata object and uses it to determine the maximum number of characters allowed for a table name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;// con is a Connection object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DatabaseMetaData dbmd = con.getMetadata();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;int maxLen = dbmd.getMaxTableNameLength();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;CODE EXAMPLE     Creating and using a DatabaseMetadata object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Retrieving General Information&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Some DatabaseMetaData methods are used to dynamically discover general&lt;br /&gt;information about a data source as well as some details about its implementation.&lt;br /&gt;Some of the methods in this category are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getURL&lt;/li&gt;&lt;li&gt;getUserName&lt;/li&gt;&lt;li&gt;getDatabaseProductVersion, getDriverMajorVersion and getDriverMinorVersion&lt;/li&gt;&lt;li&gt;getSchemaTerm, getCatalogTerm and getProcedureTerm&lt;/li&gt;&lt;li&gt;nullsAreSortedHigh and nullsAreSortedLow&lt;/li&gt;&lt;li&gt;usesLocalFiles and usesLocalFilePerTable&lt;/li&gt;&lt;li&gt;getSQLKeywords&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Determining Feature Support&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A large group of DatabaseMetaData methods can be used to determine whether a given feature or set of features is supported by the driver or underlying data source. Beyond this, some of the methods describe what level of support is provided. Some of the methods that describe support for individual features are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;supportsAlterTableWithDropColumn&lt;/li&gt;&lt;li&gt;supportsBatchUpdates&lt;/li&gt;&lt;li&gt;supportsTableCorrelationNames&lt;/li&gt;&lt;li&gt;supportsPositionedDelete&lt;/li&gt;&lt;li&gt;supportsFullOuterJoins&lt;/li&gt;&lt;li&gt;supportsStoredProcedures&lt;/li&gt;&lt;li&gt;supportsMixedCaseQuotedIdentifiers &lt;/li&gt;&lt;/ul&gt;Methods to describe a level of feature support include:&lt;ul&gt;&lt;li&gt;supportsANSI92EntryLevelSQL&lt;/li&gt;&lt;li&gt;supportsCoreSQLGrammar&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Data Source Limits&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Another group of methods provides the limits imposed by a given data source. Some of the methods in this category are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getMaxRowSize&lt;/li&gt;&lt;li&gt;getMaxStatementLength&lt;/li&gt;&lt;li&gt;getMaxTablesInSelect&lt;/li&gt;&lt;li&gt;getMaxConnections&lt;/li&gt;&lt;li&gt;getMaxCharLiteralLength&lt;/li&gt;&lt;li&gt;getMaxColumnsInTable&lt;/li&gt;&lt;/ul&gt;Methods in this group return the limit as an int. A return value of zero means that there is no limit or the limit is unknown.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;SQL Objects and Their Attributes&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Some DatabaseMetaData methods provide information about the SQL objects that populate a given data source. This group also includes methods to determine the attributes of those objects. Methods in this group return ResultSet objects in which each row describes a particular object. For example, the method getUDTs returns a ResultSet object in which there is a row for each UDT that has been defined in the data source. Examples of this category are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getSchemas and getCatalogs&lt;/li&gt;&lt;li&gt;getTables&lt;/li&gt;&lt;li&gt;getPrimaryKeys&lt;/li&gt;&lt;li&gt;getProcedures and getProcedureColumns&lt;/li&gt;&lt;li&gt;getUDTs&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Transaction Support&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A small group of methods provides information about the transaction semantics&lt;br /&gt;supported by the data source. Examples of this category include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;supportsMultipleTransactions&lt;/li&gt;&lt;li&gt;getDefaultTransactionIsolation&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;New Methods&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The JDBC 3.0 API introduces the following new DatabaseMetaData methods:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getSuperTypes — returns a description of the user-defined type hierarchies defined in a given schema in the underlying data source&lt;/li&gt;&lt;li&gt;getSuperTables — returns a description of the table hierarchies defined in a given schema in the underlying data source&lt;/li&gt;&lt;li&gt;getAttributes — returns a description of user-defined type attributes available from a given catalog in the underlying data source&lt;/li&gt;&lt;li&gt;getSQLStateType — returns the type of SQLSTATEs that will be returned by the method SQLException.getSQLState, described in “SQLException”.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;supportsSavepoints — returns true if the driver or underlying data source supports savepoints, described in “Savepoints” .&lt;br /&gt;&lt;/li&gt;&lt;li&gt;supportsNamedParameters — returns true if the driver or underlying data source supports named parameters for CallableStatement objects, described in “Setting Parameters”.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;supportsMultipleOpenResults — returns true if the driver or underlying data source supports multiple open result sets for CallableStatement objects, described in “Returning Unknown or Multiple Results”.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;supportsGetGeneratedKeys — returns true if the driver or underlying data source supports the retrieval of automatically generated keys, described in “Retrieving Auto Generated Keys” A complete definition of these methods may be found in the JDBC 3.0 API specification (javadoc).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Modified Methods&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The JDBC 3.0 API modifies the definitions of these existing DatabaseMetaData&lt;br /&gt;methods, adding support for type hierarchies:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getTables — returns descriptions of the tables that match the given catalog, schema, table name, and type criteria&lt;/li&gt;&lt;li&gt;getColumns — returns descriptions of the columns that match the given catalog, schema, table name, and column name criteria&lt;/li&gt;&lt;li&gt;getUDTs — returns descriptions of the user-defined types that match the given catalog, schema, type name, and type criteria&lt;/li&gt;&lt;li&gt;getSchemas — now returns catalog for each schema as well as the schemata. The JDBC 3.0 API specification includes updated definitions of these methods.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-4664084701972196840?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/4664084701972196840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=4664084701972196840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4664084701972196840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/4664084701972196840'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/database-metadata.html' title='Database Metadata'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1843173331928682159</id><published>2007-11-12T07:41:00.000-08:00</published><updated>2007-11-12T08:31:15.458-08:00</updated><title type='text'>Exceptions::JAVA-JDBC</title><content type='html'>The SQLException class and its subtypes provide information about errors and&lt;br /&gt;warnings that occur while a data source is being accessed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;SQLException&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;An instance of SQLException is thrown when an error occurs during an interaction&lt;br /&gt;with a data source. The exception contains the following information:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;a textual description of the error. The String containing the description can be retrieved by calling the method SQLException.getMessage.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;a SQLState. The String containing the SQLState can be retrieved by calling the method SQLException.getSQLState.The value of the SQLState string will depend on the underlying data source setting the value. Both X/Open and SQL99 define SQLState values and the conditions in which they should be set. Although the sets of values overlap, the values defined by SQL99 are not a superset of X/Open.The DatabaseMetaData method getSQLStateType allows an application todetermine if the SQLStates being returned by a data source are X/Open or SQL99.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;n an error code. This is an integer value identifying the error that caused the SQLException to be thrown. Its value and meaning are implementation specific and may be the actual error code returned by the underlying data source. The error code can be retrieved using the SQLException.getErrorCode method. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;a reference to any "chained" exceptions. If more than one error occurs or the event leading up to the exception being thrown can be described as a chain of events, the exceptions are referenced via this chain. A chained exception can be retrieved by calling the SQLException.getNextException method on the exception that was thrown. If no more exceptions are chained, the getNextException method returns null. SQLWarning, BatchUpdateException and DataTruncation are the three subclasses that extend SQLException. These subclasses are described in the following sections.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;SQLWarning&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Methods in the following interfaces will generate an SQLWarning object if they cause a database access warning:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Connection&lt;/li&gt;&lt;li&gt;Statement and its subtypes, PreparedStatement and CallableStatement&lt;/li&gt;&lt;li&gt;ResultSet&lt;/li&gt;&lt;/ul&gt;When a method generates an SQLWarning object, the caller is not informed that a data access warning has occurred. The method getWarnings must be called on the appropriate object to retrieve the SQLWarning object. However, the DataTruncation sub-class of SQLWarning may be thrown in some circumstances, see “DataTruncation” on page 50 for more details.&lt;br /&gt;If multiple data access warnings occur, they are chained to the first one and can be retrieved by calling the SQLWarning.getNextWarning method. If there are no more warnings in the chain, getNextWarning returns null. Subsequent SQLWarning objects continue to be added to the chain until the next statement is executed or, in the case of a ResultSet object, when the cursor is repositioned, at which point all SQLWarning objects in the chain are removed.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;DataTruncation&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The DataTruncation class, a sub-class of SQLWarning, provides information when data is truncated. When data truncation occurs on a write to the data source, a DataTruncation object is thrown. The data value that has been truncated may have been written to the data source even if a warning has been generated. When data trucation occurs on a read from the data source, a SQLWarning is reported. A DataTruncation object contains the following information:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the descriptive String "Data truncation"&lt;/li&gt;&lt;li&gt;the SQLState "01004"&lt;/li&gt;&lt;li&gt;a boolean to indicated whether a column value or a parameter was truncated. The method DataTruncation.getParameter returns true if a parameter wastruncated and false if a column value was truncated.&lt;/li&gt;&lt;li&gt;an int giving the index of the column or parameter that was truncated. If the index of the column or parameter is unknown, the method DataTruncation.getIndex returns -1. If the index is unknown, the values returned by the methods DataTruncation.getParameter and DataTruncation.getRead are undefined.&lt;/li&gt;&lt;li&gt;a boolean to indicate whether the truncation occurred on a read or a write operation. The method DataTruncation.getRead returns true if the truncation occurred on a read and false if the truncation occurred on a write.&lt;/li&gt;&lt;li&gt;an int indicating the the size of the target field in bytes. The method DataTruncation.getDataSize returns the number of bytes of data that could have been transferred or -1 if the number of bytes is unknown.&lt;/li&gt;&lt;li&gt;an int indicating the actual number of bytes that were transferred. The method DataTruncation.getTransferSize returns the number of bytes actually transferred or -1 if the number of bytes is unknown.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Silent Truncation&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The Statement.setMaxFieldSize method allows a maximum size (in bytes) to&lt;br /&gt;be set. This limit applies only to the BINARY, VARBINARY, LONGVARBINARY, CHAR,&lt;br /&gt;VARCHAR and LONGVARCHAR data types.&lt;br /&gt;&lt;br /&gt;If a limit has been set using setMaxFieldSize and there is an attempt to read or&lt;br /&gt;write data that exceeds the limit, any truncation that occurs as a result of exceeding&lt;br /&gt;the set limit will not be reported.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;BatchUpdateException&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A BatchUpdateException object provides information about errors that occur&lt;br /&gt;while a batch of statements is being executed. This exception’s behavior is described&lt;br /&gt;in “Batch Updates”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-1843173331928682159?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/1843173331928682159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=1843173331928682159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1843173331928682159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1843173331928682159'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/exceptionsjava.html' title='Exceptions::JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-6319433624885037171</id><published>2007-11-12T07:33:00.000-08:00</published><updated>2007-11-12T07:40:38.311-08:00</updated><title type='text'>Connections::Drivers</title><content type='html'>A Connection object represents a connection to a data source via a JDBC technology-enabled driver. The data source can be a DBMS, a legacy file system, or some other source of data with a corresponding JDBC driver. A single application using the JDBC API may maintain multiple connections. These connections may access multiple data sources, or they may all access a single data source. From the JDBC driver perspective, a Connection object represents a client session. It has associated state information such as user ID, a set of SQL statements and result sets being used in that session, and what transaction semantics are in effect.&lt;br /&gt;&lt;br /&gt;To obtain a connection, the application may interact with either:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the DriverManager class working with one or more Driver implementations OR&lt;/li&gt;&lt;li&gt;a DataSource implementation&lt;/li&gt;&lt;/ul&gt;Using a DataSource object is the preferred method because it enhances application portability, it makes code maintenance easier, and it makes it possible for an application to transparently make use of connection pooling and distributed transactions. All J2EE components that establish a connection to a data source use a DataSource object to get a connection. This chapter describes the various types of JDBC drivers and the use of the Driver interface, the DriverManager class, and the basic DataSource interface. DataSource implementations that support connection pooling and distributed transactions are discussed in Chapters  “Distributed Transactions”.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Types of Drivers&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;There are many possible implementations of JDBC drivers. These implementations&lt;br /&gt;are categorized as follows:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Type 1 — drivers that implement the JDBC API as a mapping to another data access API, such as ODBC. Drivers of this type are generally dependent on a native library, which limits their portability. The JDBC-ODBC Bridge driver is an&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;example of a Type 1 driver.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Type 2 — drivers that are written partly in the Java programming language and partly in native code. These drivers use a native client library specific to the data source to which they connect. Again, because of the native code, their portability is limited.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Type 3 — drivers that use a pure Java client and communicate with a middleware server using a database-independent protocol. The middleware server then communicates the client’s requests to the data source.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Type 4 — drivers that are pure Java and implement the network protocol for a specific data source. The client connects directly to the data source.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;The Driver Interface&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;JDBC drivers must implement the Driver interface, and the implementation must contain a static initializer that will be called when the driver is loaded. This initializer registers a new instance of itself with the DriverManager, as shown in&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE 9-1.&lt;br /&gt;public class AcmeJdbcDriver implements java.sql.Driver {&lt;br /&gt;static {&lt;br /&gt;java.sql.DriverManager.registerDriver(new AcmeJdbcDriver());&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;CODE EXAMPLE  Example static initializer for a driver implementing&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;java.sql.Driver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;When an application loads a Driver implementation, which is shown in&lt;br /&gt;CODE EXAMPLE  the static initializer will automatically register an instance of the driver.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Class.forName(“com.acme.jdbc.AcmeJdbcDriver”);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       Loading a driver that implements java.sql.Driver To insure that drivers can be loaded using this mechanism, drivers are required to provide a niladic constructor.&lt;br /&gt;The DriverManager class invokes Driver methods when it wishes to interact with a registered driver. The Driver interface also includes the method acceptsURL. The DriverManager can use this method to determine which of its registered drivers it should use for a given URL.&lt;br /&gt;When the DriverManager is trying to establish a connection, it calls that driver’s connect method and passes the driver the URL. If the Driver implementation understands the URL, it will return a Connection object; otherwise it returns null.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;The DriverManager Class&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The DriverManager class works with the Driver interface to manage the set of drivers available to a JDBC client. When the client requests a connection and provides a URL, the DriverManager is responsible for finding a driver that recognizes the URL and using it to connect to the corresponding data source.&lt;br /&gt;Key DriverManager methods include:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;registerDriver — this method adds a driver to the set of available drivers and is invoked implicitly when the driver is loaded. The registerDriver method is typically called by the static initializer provided by each driver.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;getConnection — the method the JDBC client invokes to establish a connection. The invocation includes a JDBC URL, which the DriverManager passes to each driver in its list until it finds one whose Driver.connect method recognizes the URL. That driver returns a Connection object to the DriverManager, which in turn passes it to the application.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;CODE EXAMPLE   illustrates how a JDBC client obtains a connection from the DriverManager.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;// Load the driver. This creates an instance of the driver&lt;br /&gt;// and calls the registerDriver method to make acme.db.Driver&lt;br /&gt;// available to clients.&lt;br /&gt;Class.forName(“acme.db.Driver”);&lt;br /&gt;Chapter 9 Connections 56&lt;br /&gt;// Set up arguments for the call to the getConnection method.&lt;br /&gt;// The sub-protocol “odbc” in the driver URL indicates the&lt;br /&gt;// use of the JDBC-ODBC bridge.&lt;br /&gt;String url = “jdbc:odbc:DSN”;&lt;br /&gt;String user = “SomeUser”;&lt;br /&gt;String passwd = “SomePwd”;&lt;br /&gt;// Get a connection from the first driver in the DriverManager&lt;br /&gt;// list that recognizes the URL “jdbc:odbc:DSN”.&lt;br /&gt;Connection con = DriverManager.getConnection(url, user, passwd);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE   Loading a driver and getting a connection using the DriverManager The DriverManager class also provides two other getConnection methods:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;getConnection(String url) for connecting to data sources that do not use username and passwords.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;getConnection(String url, java.util.Properties prop), which allows the client to connect using a set of properties describing the user name and password along with any addition information that may be required. The DriverPropertyInfo class provides information on the properties that the JDBC driver can understand. See the JDBC 3.0 API Specification for more details.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;The SQLPermission Class&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The SQLPermission class represents a set of permissions that a codebase may be&lt;br /&gt;granted. Currently the only permission defined is setLog. The SecurityManager will check for the setLog permission when an Applet calls one of the DriverManager methods setLogWriter and setLogStream. If the codebase does not have the setLog permission a java.lang.SecurityException exception will be thrown.  See the JDBC 3.0 API Specification for more details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-6319433624885037171?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/6319433624885037171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=6319433624885037171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/6319433624885037171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/6319433624885037171'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/connectionsdrivers.html' title='Connections::Drivers'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-6828895013645483961</id><published>2007-11-12T07:28:00.000-08:00</published><updated>2007-11-12T07:33:19.873-08:00</updated><title type='text'>Connections::The DataSource Interface</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;The DataSource Interface&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The DataSource interface, introduced in JDBC 2.0 Optional Package, is the preferred approach to obtaining data source connections. A JDBC driver that implements the Datasource interface returns connections that implement the same interface, Connection, as those returned by a DriverManager using the Driver interface. Using a Datasource object increases application portability by making it possible for an application to use a logical name for a data source instead&lt;br /&gt;of having to supply information specific to a particular driver. A logical name is mapped to a DataSource object via a naming service that uses the Java Naming and Directory InterfaceTM (JNDI). The DataSource object, represents a physical data source and provides connections to that data source. If the data source or information about it changes, the properties of the DataSource object can simply be modified to reflect the changes; no change in application code is necessary.&lt;br /&gt;&lt;br /&gt;The DataSource interface can be implemented so that it transparently provides the&lt;br /&gt;following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Increased performance and scalability through connection pooling&lt;/li&gt;&lt;li&gt;Support for distributed transactions through the XADataSource interface&lt;/li&gt;&lt;/ul&gt;The next three sections discuss (1) basic DataSource properties, (2) how logical&lt;br /&gt;naming using the JNDI API improves an applications portability and makes it easier&lt;br /&gt;to maintain, and (3) how to obtain a connection.&lt;br /&gt;Connection pooling and distributed transactions will be discussed in Chapter 11&lt;br /&gt;“Connection Pooling” and Chapter 12 “Distributed Transactions”.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; DataSource Properties&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The JDBC API defines a set of properties to identify and describe a DataSource implementation. The actual set required for a specific implementation depends on the type of DataSource object, that is, whether it is a basic DataSource object, a ConnectionPoolDataSource object, or an XADataSource object. The only property required for all DataSource implementations is description.&lt;br /&gt;&lt;br /&gt;DataSource properties follow the convention specified for properties of&lt;br /&gt;JavaBeansTM components in the JavaBeans 1.01 Specification. DataSource&lt;br /&gt;implementations may augment this set with implementation-specific properties. If&lt;br /&gt;new properties are added, they must be given names that do not conflict with the&lt;br /&gt;standard property names.DataSource implementations must provide “getter” and “setter” methods for eachproperty they support. These properties typically are initialized when the&lt;br /&gt;DataSource object is deployed, as in&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE  in which a VendorDataSource object implements the DataSource interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;VendorDataSource vds = new VendorDataSource();&lt;br /&gt;vds.setServerName(“my_database_server”);&lt;br /&gt;String name = vds.getServerName();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE          Setting and getting a DataSource property DataSource properties are not intended to be directly accessible by JDBC clients. This design is reinforced by defining the access methods on the implementation class rather than on the public DataSource interface used by applications. Furthermore, the object that the client manipulates can be a wrapper that only implements the DataSource interface. The setter and getter methods for the properties need not be exposed to the client.&lt;br /&gt;&lt;br /&gt;Management tools that need to manipulate the properties of a DataSource implementation can access those properties using introspection. The JNDI API and Application Portability&lt;br /&gt;The Java Naming and Directory Interface (JNDI) API provides a uniform way for applications to access remote services over the network. This section describes how it is used to register and access a JDBC DataSource object. See the JNDI specification for a complete description of this interface. Using the JNDI API, applications can access a DataSource object by specifying its&lt;br /&gt;logical name. A naming service using the JNDI API maps this logical name to a corresponding data source. This scheme greatly enhances portability because any of the DataSource properties, such as portNumber or serverName, can be changed without impacting the JDBC client code. In fact, the application can be re-directed to a different underlying data source in a completely transparent fashion. This is particularly useful in the three-tier environment, where an application server hides the details of accessing different data sources.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE    illustrates the use of a JNDI-based naming service to deploy a new VendorDataSource object.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;// Create a VendorDataSource object and set some properties&lt;br /&gt;VendorDataSource vds = new VendorDataSource();&lt;br /&gt;vds.setServerName(“my_database_server”);&lt;br /&gt;vds.setDatabaseName(“my_database”);&lt;br /&gt;vds.setDescription(“data source for inventory and personnel”);&lt;br /&gt;// Use the JNDI API to register the new VendorDataSource object.&lt;br /&gt;// Reference the root JNDI naming context and then bind the&lt;br /&gt;// logical name “jdbc/AcmeDB” to the new VendorDataSource object.&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;ctx.bind(“jdbc/AcmeDB”, vds);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE   Registering a DataSource object with a JNDI-based naming service&lt;br /&gt;Note – J2EE components use a special convention for naming their data sources —&lt;br /&gt;see Chapter 5 "Naming" in the J2EE platform specification for more details.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Getting a Connection with a DataSource Object&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Once a DataSource object has been registered with a JNDI-based naming service,&lt;br /&gt;an application can use it to obtain a connection to the physical data source that it&lt;br /&gt;represents, as is done in&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;// Get the initial JNDI naming context&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;// Get the DataSource object associated with the logical name&lt;br /&gt;// “jdbc/AcmeDB” and use it to obtain a database connection&lt;br /&gt;DataSource ds = (DataSource)ctx.lookup(“jdbc/AcmeDB”);&lt;br /&gt;Connection con = ds.getConnection(“user”, “pwd”);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE Getting a Connection object using a DataSource object&lt;br /&gt;The DataSource implementation bound to the name “jdbc/AcmeDB” can be&lt;br /&gt;modified or replaced without affecting the application code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-6828895013645483961?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/6828895013645483961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=6828895013645483961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/6828895013645483961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/6828895013645483961'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/connectionsthe-datasource-interface.html' title='Connections::The DataSource Interface'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-9222572801867503171</id><published>2007-11-12T07:24:00.000-08:00</published><updated>2007-11-12T08:31:36.138-08:00</updated><title type='text'>Transactions::JAVA-JDBC</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Transaction Boundaries and Autocommit&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;When to start a new transaction is a decision made implicitly by either the JDBC driver or the underlying data source. Although some data sources implement an explicit “begin transaction” statement, there is no JDBC API to do so. Typically, a new transaction is started when the current SQL statement requires one and there is no transaction already in place. Whether or not a given SQL statement requires a transaction is also specified by SQL99.&lt;br /&gt;&lt;br /&gt;The Connection attribute auto-commit specifies when to end transactions. Enabling auto-commit causes the JDBC driver to do a transaction commit after each individual SQL statement as soon as it is complete. The point at which a statement is considered to be “complete” depends on the type of SQL statement as well as what the application does after executing it:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For Insert, Update, Delete, and DDL statements, the statement is complete as soon as it has finished executing.&lt;/li&gt;&lt;li&gt;For Select statements, the statement is complete when the associated result set is closed. The result set is closed as soon as one of the following occurs:&lt;/li&gt;&lt;li&gt;all of the rows have been retrieved&lt;/li&gt;&lt;li&gt;the associated Statement object is re-executed&lt;/li&gt;&lt;li&gt;For CallableStatement objects, the statement is complete when all of the associated result sets have been closed.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Disabling Auto-commit Mode&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE      shows how to disable auto-commit mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;// Assume con is a Connection object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;con.setAutoCommit(false);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;CODE EXAMPLE            Setting auto-commit off When auto-commit is disabled, each transaction must be explicitly commited by calling the Connection method commit or explicitly rolled back by calling the Connection method rollback, respectively. This is appropriate for cases where transaction management is being done in a layer above the driver, such as:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;when the application needs to group multiple SQL statements into a single transaction&lt;/li&gt;&lt;li&gt;when the transaction is being managed by the application server&lt;/li&gt;&lt;/ul&gt;The default is for auto-commit mode to be enabled when the Connection object is created. If the value of auto-commit is changed in the middle of a transaction, the current transaction is committed. It is an error to enable auto-commit for a connection participating in a distributed transaction, as described in “Distributed Transactions”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-9222572801867503171?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/9222572801867503171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=9222572801867503171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/9222572801867503171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/9222572801867503171'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/transactionsjava.html' title='Transactions::JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2720606856338954987</id><published>2007-11-12T07:20:00.000-08:00</published><updated>2007-11-12T07:24:28.438-08:00</updated><title type='text'>Transactions::Transaction Isolation Levels</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Transaction Isolation Levels&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Transaction isolation levels specify what data is “visible” to the statements within a&lt;br /&gt;transaction. They directly impact the level of concurrent access by defining what&lt;br /&gt;interaction, if any, is possible between transactions against the same target data&lt;br /&gt;source. Possible interaction between concurrent transactions is categorized as&lt;br /&gt;follows:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; dirty reads occur when transactions are allowed to see uncommitted changes to the data. In other words, changes made inside a transaction are visible outside the transaction before it is commited. If the changes are rolled back instead of being committed, it is possible for other transactions to have done work based on incorrect, transient data.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;nonrepeatable reads occur when:&lt;/li&gt;&lt;/ul&gt;        a. Transaction A reads a row&lt;br /&gt;        b. Transaction B changes the row&lt;br /&gt;        c. Transaction A reads the same row a second time and gets different results&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;phantom reads occur when:&lt;/li&gt;&lt;/ul&gt;        a. Transaction A reads all rows that satisfy a WHERE condition&lt;br /&gt;        b. Transaction B inserts an additional row that satisfies the same condition&lt;br /&gt;        c. Transaction A reevaluates the WHERE condition and picks up the additional “phantom”             row&lt;br /&gt;&lt;br /&gt;JDBC augments the four levels of transaction isolation defined by SQL99, by adding&lt;br /&gt;TRANSACTION_NONE. From least restrictive to most restrictive, the transaction&lt;br /&gt;isolation levels are:&lt;br /&gt;&lt;br /&gt;1. TRANSACTION_NONE — indicates that the driver does not support transactions,&lt;br /&gt;which means that it is not a JDBC compliant driver.&lt;br /&gt;2. TRANSACTION_READ_UNCOMMITTED — allows transactions to see uncommitted&lt;br /&gt;changes to the data. This means that dirty reads, nonrepeatable reads, and&lt;br /&gt;phantom reads are possible.&lt;br /&gt;3. TRANSACTION_READ_COMMITTED — means that any changes made inside a&lt;br /&gt;transaction are not visible outside the transaction until the transaction is&lt;br /&gt;committed. This prevents dirty reads, but nonrepeatable reads and phantom&lt;br /&gt;reads are still possible.&lt;br /&gt;4. TRANSACTION_REPEATABLE_READ — disallows dirty reads and nonrepeatable&lt;br /&gt;reads. Phantom read are still possible.&lt;br /&gt;5. TRANSACTION_SERIALIZABLE — specifies that dirty reads, nonrepeatable reads,&lt;br /&gt;and phantom reads are prevented.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Using the setTransactionIsolation Method&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The default transaction level for a Connection object is determined by the driver&lt;br /&gt;supplying the connection. Typically, it is the default transaction level supported by&lt;br /&gt;the underlying data source.&lt;br /&gt;&lt;br /&gt;The Connection method setTransactionIsolation is provided to allow JDBC clients to change the transaction isolation level for a given Connection object. The new isolation level remains in effect for the remainder of the session or until the next invocation of the setTransactionIsolation method. The result of invoking the method setTransactionIsolation in the middle of a transaction is implementation-defined. The return value of the method getTransactionIsolation should reflect the change in isolation level when it actually occurs. It is recommended that drivers implement the setTransactionIsolation method to change the isolation level&lt;br /&gt;starting with the next transaction. Committing the current transaction to make the effect immediate is also a valid implementation. It is possible for a given JDBC driver to not support all four transaction isolation levels (not counting TRANSACTION_NONE). If a driver does not support the isolation level specified in an invocation of setTransactionIsolation, it is allowed to&lt;br /&gt;substitute a higher, more restrictive transaction isolation level. If a driver is unable to substitute a higher transaction level, it throws an SQLException. The DatabaseMetaData method supportsTransactionIsolationLevel may be used to determine whether or not the driver supports a given level.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Performance Considerations&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;As the transaction isolation level increases, more locking and other DBMS overhead is required to ensure the correct semantics. This in turn lowers the degree of concurrent access that can be supported. As a result, applications may see decreased performance when they use a higher transaction isolation level. For this reason, the transaction manager, whether it is the application itself or part of the application server, should weigh the need for data consistency against the requirements for performance when determining which transaction isolation level is appropriate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2720606856338954987?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2720606856338954987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2720606856338954987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2720606856338954987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2720606856338954987'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/transactionstransaction-isolation.html' title='Transactions::Transaction Isolation Levels'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-8904678826245989927</id><published>2007-11-12T07:16:00.000-08:00</published><updated>2007-11-12T07:20:25.990-08:00</updated><title type='text'>Transactions::SavePoints</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Savepoints&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Savepoints provide finer-grained control of transactions by marking intermediate points within a transaction. Once a savepoint has been set, the transaction can be rolled back to that savepoint without affecting preceding work. The DatabaseMetaData.supportsSavepoints method can be used to determine whether a JDBC driver and DBMS support savepoints.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Setting and Rolling Back to a Savepoint&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The JDBC 3.0 API adds the method Connection.setSavepoint, which sets a savepoint within the current transaction. The Connection.rollback method has been overloaded to take a savepoint argument.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE    inserts a row into a table, sets the savepoint svpt1, and then inserts a second row. When the transaction is later rolled back to svpt1, the second  insertion is undone, but the first insertion remains intact. In other words, when the transaction is committed, only the row containing ’FIRST’ will be added to TAB1.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;conn.createStatement();&lt;br /&gt;int rows = stmt.executeUpdate("INSERT INTO TAB1 (COL1) VALUES " +&lt;br /&gt;"(’FIRST’)");&lt;br /&gt;// set savepoint&lt;br /&gt;Savepoint svpt1 = conn.setSavepoint("SAVEPOINT_1");&lt;br /&gt;rows = stmt.executeUpdate("INSERT INTO TAB1 (COL1) " +&lt;br /&gt;"VALUES (’SECOND’)");&lt;br /&gt;...&lt;br /&gt;conn.rollback(svpt1);&lt;br /&gt;...&lt;br /&gt;conn.commit();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       Rolling back a transaction to a savepoint&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; Releasing a Savepoint&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The method Connection.releaseSavepoint takes a Savepoint object as a parameter and removes it from the current transaction.  Once a savepoint has been released, attempting to reference it in a rollback operation will cause an SQLException to be thrown. Any savepoints that have been created in a transaction are automatically released and become invalid when the transaction is committed or when the entire transaction is rolled back. Rolling a transaction back to a savepoint automatically releases and makes invalid any other savepoints that were created after the savepoint in question&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-8904678826245989927?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/8904678826245989927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=8904678826245989927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/8904678826245989927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/8904678826245989927'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/transactionssavepoints.html' title='Transactions::SavePoints'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2280062016579651625</id><published>2007-11-12T06:36:00.000-08:00</published><updated>2007-11-12T08:32:19.633-08:00</updated><title type='text'>Connection Pooling2:JAVA-JDBC</title><content type='html'>In a basic DataSource implementation, there is a 1:1 correspondence between the&lt;br /&gt;client’s Connection object and the physical database connection. When the Connection object is closed, the physical connection is dropped. Thus, the overhead of opening, initializing, and closing the physical connection is incurred for each client session. A connection pool solves this problem by maintaining a cache of physical database connections that can be reused across client sessions. Connection pooling greatly improves performance and scalability, particularly in a three-tier environment where multiple clients can share a smaller number of physical database connections. In&lt;br /&gt;&lt;br /&gt;The algorithm used to manage the connection pool is implementation-specific and varies with application servers. The application server provides its clients with an implementation of the DataSource interface that makes connection pooling transparent to the client. As a result, the client gets better performance and scalability while using the same JNDI and DataSource APIs as before.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This chapter also describes some important differences&lt;br /&gt;&lt;br /&gt;Application Server&lt;br /&gt;JDBC&lt;br /&gt;Application&lt;br /&gt;Cache of&lt;br /&gt;PooledConnection objects&lt;br /&gt;JDBC Driver&lt;br /&gt;logical&lt;br /&gt;Connection&lt;br /&gt;object&lt;br /&gt;physical&lt;br /&gt;PooledConnection&lt;br /&gt;object&lt;br /&gt;ConnectionPoolDataSource API&lt;br /&gt;DataSource API&lt;br /&gt;&lt;br /&gt;between a basic DataSource object and one that implements connection pooling. In addition, it discusses how a pooled connection can maintain a pool of reusable PrepredStatement objects.&lt;br /&gt;Although much of the discussion in this chapter assumes a three-tier environment, connection pooling is also relevant in a two-tier environment. In a two-tier environment, the JDBC driver implements both the DataSource and ConnectionPoolDataSource interfaces. This implementation allows an application that opens and closes multiple connections to benefit from connection pooling.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;ConnectionPoolDataSource and PooledConnection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Typically, a JDBC driver implements the ConnectionPoolDataSource interface, and the application server uses it to obtain PooledConnection objects.&lt;br /&gt;CODE EXAMPLE   shows the signatures for the two versions of the getPooledConnection method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;public interface ConnectionPoolDataSource {&lt;br /&gt;PooledConnection getPooledConnection() throws SQLException;&lt;br /&gt;PooledConnection getPooledConnection(String user,&lt;br /&gt;String password) throws SQLException;&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE          The ConnectionPoolDataSource interface A PooledConnection object represents a physical connection to a data source. The JDBC driver’s implementation of PooledConnection encapsulates all of the details of maintaining that connection. An application server caches and reuses PooledConnection objects within its implementation of the DataSource interface. When a client calls the method DataSource.getConnection, the application server uses the physical PooledConnection object to obtain a logical Connection object.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE  shows the PooledConnection interface definition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;public interface PooledConnection {&lt;br /&gt;Connection getConnection() throws SQLException;&lt;br /&gt;void close() throws SQLException;&lt;br /&gt;void addConnectionEventListener(&lt;br /&gt;ConnectionEventListener listener);&lt;br /&gt;void removeConnectionEventListener(&lt;br /&gt;ConnectionEventListener listener);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE  The PooledConnection interface When an application is finished using a connection, it closes the logical connection using the method Connection.close. This closes the logical connection but does not close the physical connection. Instead, the physical connection is returned to the pool so that it can be reused. Connection pooling is completely transparent to the client: A client obtains a pooled connection and uses it just the same way it obtains and uses a nonpooled connection.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;font-size:100%;" &gt;Connection Events&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Recall that when an application calls the method Connection.close, the underlying physical connection—the PooledConnection object—is available for reuse. JavaBeans-style events are used to notify the connection pool manager (the application server) that a PooledConnection object can be recycled. In order to be notified of an event on a PooledConnection object, the connection pool manager must implement the ConnectionEventListener interface and then&lt;br /&gt;be registered as a listener by that PooledConnection object. The ConnectionEventListener interface defines the following two methods, which correspond to the two kinds of events that can occur on a PooledConnection object:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; connectionClosed — triggered when the logical Connection object associated with this PooledConnection object is closed, that is, the application called the method Connection.close&lt;/li&gt;&lt;li&gt; connectionErrorOccurred — triggered when a fatal error, such as the server crashing, causes the connection to be lost&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;A connection pool manager registers itself as a listener for a PooledConnection object using the PooledConnection.addConnectionEventListener method. Typically, a connection pool manager registers itself as a ConnectionEventListener before returning a Connection object to an&lt;br /&gt;application. The driver invokes the ConnectionEventListener methods connectionClosed and connectionErrorOccurred when the corresponding events occur. Both methods take a ConnectionEvent object as a parameter, which can be used to determine which PooledConnection object was closed or had an error. When the JDBC application closes its logical connection, the JDBC driver notifies the connection pool manager (the listener) by calling the listener’s implementation of the method connectionClosed. At this point, the connection pool manager can return the PooledConnection object to the pool for reuse. When an error occurs, the JDBC driver notifies the listener by calling its connectionErrorOccurred method and then throws an SQLException object to the application to notify it of the same error. In the event of a fatal error, the bad PooledConnection object is not returned to the pool. Instead, the connection pool manager calls the PooledConnection.close method on the PooledConnection object to close the physical connection.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Connection Pooling in a Three-tier Environment&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The following sequence of steps outlines what happens when a JDBC client requests a connection from a DataSource object that implements connection pooling:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; The client calls DataSource.getConnection. &lt;/li&gt;&lt;li&gt; The application server providing the DataSource implementation looks in its&lt;/li&gt;&lt;/ul&gt;connection pool to see if there is a suitable PooledConnection object— a physical database connection—available. Determining the suitability of a given PooledConnection object may include matching the client’s user authentication information or application type as well as using other implementation-specific criteria. The lookup method and other methods associated with managing the connection pool are specific to the application server.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If there are no suitable PooledConnection objects available, the application server calls the ConnectionPoolDataSource.getPooledConnection method to get a new physical connection. The JDBC driver implementing ConnectionPoolDataSource creates a newPooledConnection object and returns it to the application server.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Regardless of whether the PooledConnection was retrieved from the pool or was newly created, the application server does some internal bookkeeping to indicate that the physical connection is now in use. &lt;/li&gt;&lt;li&gt;The application server calls the method PooledConnection.getConnection to get a logical Connection object. This logical Connection object is actually a “handle” to a physical PooledConnection object, and it is this handle that is returned by the DataSource.getConnection method when connection pooling is in effect.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The application server registers itself as a ConnectionEventListener by calling the method PooledConnection.addConnectionEventListener. This is done so that the application server will be notified when the physical connection is available for reuse.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The logical Connection object is returned to the JDBC client, which uses the same Connection API as in the basic DataSource case. Note that the underlying physical connection cannot be reused until the client calls the method Connection.close. Connection pooling can also be implemented in a two-tier environment where there is no application server. In this case, the JDBC driver provides both the implementation of DataSource which is visible to the client and the underlying ConnectionPoolDataSource implementation.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;DataSource Implementations and Connection Pooling&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Aside from improved performance and scalability, a JDBC application should not see any difference between accessing a DataSource object that implements connection pooling and one that does not. However, there are some important differences in the application server and driver level implementations. A basic DataSource implementation, that is, one that does not implement connection pooling, is typically provided by a JDBC driver vendor. In a basic&lt;br /&gt;DataSource implementation, the following are true:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The DataSource.getConnection method creates a new Connection object that represents a physical connection and encapsulates all of the work to set up and manage that connection.&lt;/li&gt;&lt;li&gt;The Connection.close method shuts down the physical connection and frees the associated resources. In a DataSource implementation that includes connection pooling, a great deal happens behind the scenes. In such an implementation, the following are true:&lt;/li&gt;&lt;li&gt;The DataSource implementation includes an implementation-specific connection pooling module that manages a cache of PooledConnection objects. The DataSource object is typically implemented by the application server as a layer on top of the driver’s implementations of the ConnectionPoolDataSource and PooledConnection interfaces.&lt;/li&gt;&lt;li&gt;The DataSource.getConnection method calls PooledConnection.getConnection to get a logical handle to an underlying physical connection. The overhead of setting up a new physical connection is incurred only if there are no existing connections available in the connection pool. When a new physical connection is needed, the connection pool manager will call the ConnectionPoolDataSource method getPooledConnection to create one. The work to manage the physical connection is delegated to the PooledConnection object.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The Connection.close method closes the logical handle, but the physical connection is maintained. The connection pool manager is notified that the underlying PooledConnection object is now available for reuse. If the application attempts to reuse the logical handle, the Connection implementation throws an SQLException.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A single physical PooledConnection object may generate many logical Connection objects during its lifetime. For a given PooledConnection object, only the most recently produced logical Connection object will be valid. Any previously existing Connection object is automatically closed when the associated PooledConnection.getConnection method is called. Listeners (connection pool managers) are not notified in this case. This gives the application server a way to take a connection away from a client.  This is an unlikely scenario but may be useful if the application server is trying to force an orderly shutdown.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A connection pool manager shuts down a physical connection by calling the method PooledConnection.close. This method is typically called only in certain circumstances: when the application server is undergoing an orderly shutdown, when the connection cache is being reinitialized, or when the application server receives an event indicating that an unrecoverable error has occurred on the connection.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt; Deployment&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Deploying a DataSource object that implements connection pooling requires that both a client-visible DataSource object and an underlying ConnectionPoolDataSource object be registered with a JNDI-based naming service.&lt;br /&gt;&lt;br /&gt;The first step is to deploy the ConnectionPoolDataSource implementation, as is&lt;br /&gt;done in CODE EXAMPLE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;// ConnectionPoolDS implements the ConnectionPoolDataSource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// interface. Create an instance and set properties.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;com.acme.jdbc.ConnectionPoolDS cpds =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;new com.acme.jdbc.ConnectionPoolDS();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cpds.setServerName(“bookserver”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cpds.setDatabaseName(“booklist”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cpds.setPortNumber(9040);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cpds.setDescription(“Connection pooling for bookserver”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// Register the ConnectionPoolDS with JNDI, using the logical name&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// “jdbc/pool/bookserver_pool”&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Context ctx = new InitialContext();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ctx.bind(“jdbc/pool/bookserver_pool”, cpds);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CODE EXAMPLE 11-3 Deploying a ConnectionPoolDataSource object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Once this step is complete, the ConnectionPoolDataSource implementation is&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;available as a foundation for the client-visible DataSource implementation. The&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DataSource implementation is deployed such that it references the&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ConnectionPoolDataSource implementation, as shown in CODE EXAMPLE 11-4.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// PooledDataSource implements the DataSource interface.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// Create an instance and set properties.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;com.acme.appserver.PooledDataSource ds =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;new com.acme.appserver.PooledDataSource();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ds.setDescription(“Datasource with connection pooling”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// Reference the previously registered ConnectionPoolDataSource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ds.setDataSourceName(“jdbc/pool/bookserver_pool”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// Register the DataSource implementation with JNDI, using the logical&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// name “jdbc/bookserver”.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Context ctx = new InitialContext();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ctx.bind(“jdbc/bookserver”, ds);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CODE EXAMPLE  Deploying a DataSource object backed by a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ConnectionPoolDataSource object&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2280062016579651625?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2280062016579651625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2280062016579651625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2280062016579651625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2280062016579651625'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/connection-pooling2java.html' title='Connection Pooling2:JAVA-JDBC'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7378257069502445132</id><published>2007-11-12T06:26:00.000-08:00</published><updated>2007-11-12T06:36:21.819-08:00</updated><title type='text'>Connection Pooling</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Reuse of Statements by Pooled&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt; Connections&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The JDBC 3.0 specification introduces the feature of statement pooling. This feature, which allows an application to reuse a PreparedStatement object in much the same way it can reuse a connection, is made available through a pooled connection. FIGURE 11-2 provides a logical view of how a pool of PreparedStatement objects can be associated with a PooledConnection object. As with the PooledConnection object itself, the PreparedStatement objects can be reused&lt;br /&gt;by multiple logical connections in a transparent manner.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Using a Pooled Statement&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;If a pooled connection reuses statements, the reuse must be completely transparent to an application. In other words, from the application’s point of view, using a PreparedStatement object that participates in statement pooling is exactly the&lt;br /&gt;&lt;br /&gt;JDBC&lt;br /&gt;Application&lt;br /&gt;JDBC&lt;br /&gt;Application&lt;br /&gt;data source&lt;br /&gt;PooledConnection&lt;br /&gt;PooledConnection&lt;br /&gt;Connection Pool&lt;br /&gt;Application Server&lt;br /&gt;Pool of&lt;br /&gt;PreparedStatement&lt;br /&gt;Objects&lt;br /&gt;Pool of&lt;br /&gt;PreparedStatement&lt;br /&gt;Objects&lt;br /&gt;&lt;br /&gt;same as using one that does not. Statements are kept open for reuse entirely under the covers, so there is no change in application code. If an application closes a PreparedStatement object, it must still call Connection.prepareStatement in order to use it again. The only visible effect of statement pooling is a possible improvement in performance. An application may find out whether a data source supports statement pooling by calling the DatabaseMetaData method supportsStatementPooling. If the return value is true, the application can then choose to use PreparedStatement objects knowing that they are being pooled. In many cases, reusing statements is a significant optimization. This is especially true for complex prepared statements. However, it should also be noted that leaving large numbers of statements open may have an adverse impact on the use of resources.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Closing a Pooled Statement&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;An application closes a pooled statement exactly the same way it closes a nonpooled statement. Whether it is pooled or not, a statement that has been closed is no longer available for use by the application, and an attempt to reuse it will cause an exception to be thrown.&lt;br /&gt;&lt;br /&gt;The following methods can close a pooled statement:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Statement.close — called by an application; if the statement is being pooled, closes the logical statement used by the application but does not close the physical statement being pooled&lt;/li&gt;&lt;li&gt; Connection.close — called by an application&lt;/li&gt;&lt;li&gt; Nonpooled connection — closes the physical connection and all statements created by that connection. This is necessary because the garbage collection mechanism is unable to detect when externally managed resources can be released.&lt;/li&gt;&lt;li&gt;Pooled connection — closes the logical connection and the logical statements it returned but leaves open the underlying PooledConnection object and any associated pooled statements&lt;/li&gt;&lt;li&gt;PooledConnection.closeAll — called by the connection pool manager to close all of the physical statements being pooled by the PooledConnection object&lt;/li&gt;&lt;/ul&gt;An application cannot directly close a physical statement that is being pooled; instead, this is done by the connection pool manager. The method  PooledConnection.closeAll closes all of the statements open on a given physical connection, which releases the resources associated with those statements.&lt;br /&gt;&lt;br /&gt;An application also has no direct control over how statements are pooled. A pool of statements is associated with a PooledConnection object, whose behaviour is determined by the properties of the ConnectionPoolDataSource object that produced it.  “ConnectionPoolDataSource Properties” discusses these properties.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;ConnectionPoolDataSource Properties&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;As with the DataSource interface, the JDBC API defines a set of properties that can used to configure the behaviour of connection pools. These are shown in Connection pool configuration properties follow the convention specified for JavaBeans components in the JavaBeans specification. Connection pool vendors may choose to augment this set with implementation-specific properties. If so, the additional properties must be given names that do not conflict with the standard property names.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Standard Connection Pool Properties&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Property Name Type Description maxStatements int The total number of statements that the pool should keep open. 0 (zero) indicates that caching of statements is disabled. initialPoolSize int The number of physical connections the pool should contain when it is created minPoolSize int The number of physical connections the pool should keep available at all times. 0 (zero) indicates that connections should be created as needed. maxPoolSize int The maximum number of physical connections that the pool should contain. 0 (zero) indicates no maximum size.&lt;br /&gt;maxIdleTime int The number of seconds that a physical connection should remain unused in the pool before the connection is closed. 0 (zero) indicates no limit. propertyCycle int The interval, in seconds, that the pool should wait before enforcing the current policy defined by the values of the above connection pool properties&lt;br /&gt;&lt;br /&gt;Like DataSource implementations, ConnectionPoolDataSource implementations must provide “getter” and “setter” methods for each property they support. These properties are typically initialized when the ConnectionPoolDataSource object is deployed.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE            illustratessetting properties in a vendor’s implementation of the ConnectionPoolDataSource interface.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;VendorConnectionPoolDS vcp = new VendorConnectionPoolDS();&lt;br /&gt;vcp.setMaxStatements(25);&lt;br /&gt;vcp.setInitialPoolSize(10);&lt;br /&gt;vcp.setMinPoolSize(1);&lt;br /&gt;vcp.setMaxPoolSize(0);&lt;br /&gt;vcp.setMaxIdleTime(0);&lt;br /&gt;vcp.setPropertyCycle(300);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       Setting connection pool configuration properties The properties set on a ConnectionPoolDataSource object apply to the PooledConnection objects that it creates. An application server managing a pool of PooledConnection objects uses these properties to determine how to manage its pool. ConnectionPoolDataSource configuration properties are not intended to be directly accessible by JDBC clients. Management tools that need to manipulate the properties of a ConnectionPoolDataSource implementation can access those properties using introspection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7378257069502445132?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7378257069502445132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7378257069502445132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7378257069502445132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7378257069502445132'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/connection-pooling.html' title='Connection Pooling'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1837142543194075806</id><published>2007-11-12T06:24:00.000-08:00</published><updated>2007-11-12T06:26:11.277-08:00</updated><title type='text'>Distributed Transactions</title><content type='html'>Up to this point, the discussion of transactions has focused on the local case—&lt;br /&gt;transactions involving a single data source. This chapter introduces the distributed&lt;br /&gt;case where a single transaction involves multiple connections to one or more&lt;br /&gt;underlying data sources.&lt;br /&gt;&lt;br /&gt;The following discussion includes these topics:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; distributed transaction infrastructure&lt;/li&gt;&lt;li&gt; transaction managers and resource managers&lt;/li&gt;&lt;li&gt; the XADataSource, XAConnection, and XAResource interfaces&lt;/li&gt;&lt;li&gt; two-phase commit&lt;/li&gt;&lt;/ul&gt;Transaction management in the JDBC API is designed to fit with the Java Transaction&lt;br /&gt;APITM (JTATM) . The examples presented here are high-level; the JTA specification&lt;br /&gt;should be consulted for a more substantial discussion.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Infrastructure&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Distributed transactions require an infrastructure that provides these roles:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Transaction manager — controls transaction boundaries and manages the twophase commit protocol. This typically will be an implementation of JTA.&lt;/li&gt;&lt;li&gt;  JDBC drivers that implement the XADataSource, XAConnection, and XAResource interfaces. These are described in the next section.&lt;/li&gt;&lt;li&gt;An application-visible implementation of DataSource to “sit on top of” each XADataSource object and interact with the transaction manager. The DataSource implementation is typically provided by an application server. Because the XADataSource interface extends the ConnectionPoolDataSource interface, the DataSource implementation will usually include a connection pooling module as well.&lt;/li&gt;&lt;li&gt;Resource manager(s) to manage the underlying data. In the context of the JDBC&lt;/li&gt;&lt;/ul&gt;API, a resource manager is a DBMS server. The term “resource manager” is borrowed from JTA to emphasize the point that distributed transactions using the JDBC API follow the architecture specified in that document. This infrastructure is most often implemented in a three-tier architecture that  includes the following:&lt;br /&gt;&lt;br /&gt;1. A client tier&lt;br /&gt;2. A middle tier that includes applications, an EJB server working with an external transaction manager, and a set of JDBC drivers&lt;br /&gt;3. Multiple resource managers&lt;br /&gt;&lt;br /&gt;Distributed transactions can also be implemented in two tiers. In a two-tier&lt;br /&gt;architecture, the application itself acts as the transaction manager and interacts&lt;br /&gt;directly with the JDBC drivers’ XADataSource implementations.&lt;br /&gt;The following diagram illustrates the distributed transaction infrastructure:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-1837142543194075806?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/1837142543194075806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=1837142543194075806' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1837142543194075806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/1837142543194075806'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/distributed-transactions.html' title='Distributed Transactions'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2969457450109310074</id><published>2007-11-12T06:07:00.000-08:00</published><updated>2007-11-12T08:33:39.047-08:00</updated><title type='text'>Distributed Transactions::JAVA-JDBC2</title><content type='html'>&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;XADataSource and XAConnection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The XADataSource and XAConnection interfaces, which are defined in the package javax.sql, are implemented by JDBC drivers that support distributed transactions. An XAConnection object is a pooled connection that can participate in a distributed transaction. More precisely, XAConnection extends the PooledConnection interface by adding the method getXAResource. This method produces an XAResource object that can be used by a transaction manager to coordinate the work done on this connection with the other participants in the distributed transaction.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE  gives the definition of the XAConnection interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;public interface XAConnection extends PooledConnection {&lt;br /&gt;javax.transaction.xa.XAResource getXAResource()&lt;br /&gt;throws SQLException;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE     The XAConnection interface Because they extend the PooledConnection interface, XAConnection objects support all the methods of PooledConnection objects. They are reusable physical connections to an underlying data source and produce logical connection handles that can be passed back to a JDBC application. XAConnection objects are produced by an XADataSource object. There is some similarity between ConnectionPoolDataSource objects and XADataSource objects in that they are both implemented below a DataSource layer that is visible to the JDBC application. This architecture allows JDBC drivers to support distributed transactions in a way that is transparent to the application.&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE         shows the signatures for the two getXAConnection methods&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;defined in XADataSource.&lt;br /&gt;public interface XADataSource {&lt;br /&gt;XAConnection getXAConnection() throws SQLException;&lt;br /&gt;XAConnection getXAConnection(String user,&lt;br /&gt;String password) throws SQLException;&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE           The XADataSource interface Typically, DataSource implementations built on top of an XADataSource implementation will also include a connection pooling module.&lt;br /&gt;12.2.1 Deploying an XADataSource Object Deploying an XADataSource object is done in exactly the same manner as previously described for ConnectionPoolDataSource objects. The two-step&lt;br /&gt;process includes deploying the XADataSource object and the application-visible DataSource object, as is done in&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;// com.acme.jdbc.XADataSource implements the&lt;br /&gt;// XADataSource interface.&lt;br /&gt;// Create an instance and set properties.&lt;br /&gt;com.acme.jdbc.XADataSource xads = new com.acme.jdbc.XADataSource();&lt;br /&gt;xads.setServerName(“bookstore”);&lt;br /&gt;xads.setDatabaseName(“bookinventory”);&lt;br /&gt;xads.setPortNumber(9040);&lt;br /&gt;xads.setDescription(“XADataSource for inventory”);&lt;br /&gt;// First register xads with a JNDI naming service, using the&lt;br /&gt;// logical name “jdbc/xa/inventory_xa”&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;ctx.bind(“jdbc/xa/inventory_xa”, xads);&lt;br /&gt;// Next register the overlying DataSource object for application&lt;br /&gt;// access. com.acme.appserver.DataSource is an implementation of&lt;br /&gt;// the DataSource interface.&lt;br /&gt;// Create an instance and set properties.&lt;br /&gt;com.acme.appserver.DataSource ds =&lt;br /&gt;new com.acme.appserver.DataSource();&lt;br /&gt;ds.setDescription(“Datasource supporting distributed transactions”);&lt;br /&gt;// Reference the previously registered XADataSource&lt;br /&gt;ds.setDataSourceName(“jdbc/xa/inventory_xa”);&lt;br /&gt;// Register the DataSource implementation with a JNDI naming service,&lt;br /&gt;// using the logical name “jdbc/inventory”.&lt;br /&gt;ctx.bind(“jdbc/inventory”, ds);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE         Deploying a DataSource object backed by an XADataSource object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; Getting a Connection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;As in the connection pooling case, the application call to the method DataSource.getConnection returns a logical handle produced by the physical XAConnection object. The application code to get a logical connection is shown in&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;DataSource ds = (DataSource)ctx.lookup(“jdbc/inventory”);&lt;br /&gt;Connection con = ds.getConnection(“myID”,“mypasswd”);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       Application code to get a logical connection&lt;br /&gt;CODE EXAMPLE          is an example of code from the middle-tier server’s implementation of the method DataSource.getConnection.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;// Assume xads is a driver’s implementation of XADataSource&lt;br /&gt;XADataSource xads = (XADataSource)ctx.lookup(“jdbc/xa/" +&lt;br /&gt;"inventory_xa”);&lt;br /&gt;// xacon implements XAConnection&lt;br /&gt;XAConnection xacon = xads.getXAConnection(“myID”, “mypasswd”);&lt;br /&gt;// Get a logical connection to pass back up to the application&lt;br /&gt;Connection con = xacon.getConnection();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE  Getting a logical connection from an XAConnection object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; XAResource&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The XAResource interface is defined in the JTA specification and is the mapping in the Java programming language of the X/Open Group XA interface. An XAResource object is produced by calling the XAConnection.getXAResource method and is used to associate an XAConnection object with a distributed transaction. A given XAConnection object may be associated with at most one transaction at a time. The JDBC driver maintains a one-to-one correspondence&lt;br /&gt;between an XAResource object and its associated XAConnection object; that is, multiple calls to the getXAResource method must all return the same object. In a typical scenario, the middle-tier application server calls the method XAConnection.getXAResource and passes the returned object to an external transaction manager. The transaction manager uses the XAResource object exclusively—it does not access an XAConnection object directly. The transaction manager coordinates the work of multiple XAResource objects, each of which represents a resource manager participating in the distributed transaction. Note that two XAResource objects may “point” to the same resource manager, that is, they may be associated with XAConnection objects that were produced by the same XADataSource. The following XAResource methods are used by the transaction manager to implement a two-phase commit protocol.&lt;br /&gt;&lt;br /&gt;Each method takes an xid parameter that identifies the distributed transaction:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; start — tells the resource manager that the subsequent operations are part of the distributed transaction.&lt;/li&gt;&lt;li&gt; end — marks the end of this resource manager’s part of the distributed transaction.&lt;/li&gt;&lt;li&gt; prepare — gets the resource manager’s vote on whether to commit or roll back the distributed transaction.&lt;/li&gt;&lt;li&gt; commit — tells the resource manager to commit its part of the distributed transaction. This method is invoked only if all the participating resource managers voted to commit the transaction.&lt;/li&gt;&lt;li&gt; rollback — tells the resource manager to roll back its part of the distributed transaction. This method is invoked if one or more of the participating resource managers voted to roll back the transaction.&lt;/li&gt;&lt;/ul&gt;See the JTA specification for a complete description of the XAResouce interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; Transaction Management&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Participation in a distributed transaction is defined as the work done between invocations of the methods XAResource.start and XAResource.end. Outside these boundaries, the transaction mode is local, and a connection behaves exactly like a local connection. With one exception, there is no difference in how an application participating in a distributed transaction is coded. In contrast to the local case, the boundaries of a distributed transaction must be controlled by an external transaction manager that is coordinating the work of multiple connections. For this reason, it is an error for applications to call any of the following Connection methods while they are participating in a distributed transaction:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; setAutoCommit(true)&lt;/li&gt;&lt;li&gt; commit&lt;/li&gt;&lt;li&gt; rollback&lt;/li&gt;&lt;li&gt; setSavepoint&lt;/li&gt;&lt;/ul&gt;The JDBC driver throws an SQLException if one of these operations is attempted on a connection that is participating in a distributed transaction. If the connection is later used for a local transaction, these operations are legal at that point. Applications should also refrain from calling Connection.setTransactionIsolation within the bounds of a distributed transaction. The resulting behavior is implementation-defined. If a connection has auto-commit mode already enabled at the time it joins a global transaction, the attribute will be ignored. The auto-commit behavior will resume when the connection returns to local transaction mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2969457450109310074?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2969457450109310074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2969457450109310074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2969457450109310074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2969457450109310074'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/distributed-transactionsjava2.html' title='Distributed Transactions::JAVA-JDBC2'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-2261835091644453776</id><published>2007-11-12T06:00:00.000-08:00</published><updated>2007-11-12T08:33:48.095-08:00</updated><title type='text'>Distributed Transactions::JAVA-JDBC3</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Transaction Management&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Participation in a distributed transaction is defined as the work done between invocations of the methods XAResource.start and XAResource.end. Outside these boundaries, the transaction mode is local, and a connection behaves exactly like a local connection. With one exception, there is no difference in how an application participating in a distributed transaction is coded. In contrast to the local case, the boundaries of a distributed transaction must be controlled by an external transaction manager that is coordinating the work of multiple connections. For this reason, it is an error for applications to call any of the following Connection methods while they are participating in a distributed transaction:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; setAutoCommit(true)&lt;/li&gt;&lt;li&gt; commit&lt;/li&gt;&lt;li&gt; rollback&lt;/li&gt;&lt;li&gt; setSavepoint&lt;/li&gt;&lt;/ul&gt;The JDBC driver throws an SQLException if one of these operations is attempted on a connection that is participating in a distributed transaction. If the connection is later used for a local transaction, these operations are legal at that point. Applications should also refrain from calling Connection.setTransactionIsolation within the bounds of a distributed transaction. The resulting behavior is implementation-defined. If a connection has auto-commit mode already enabled at the time it joins a global transaction, the attribute will be ignored. The auto-commit behavior will resume when the connection returns to local transaction mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Two-phase Commit&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The following steps outline how a transaction manager uses XAResource objects to implement the two-phase commit protocol. These steps assume a three-tier architecture where an application server is working with an external transaction manager:&lt;br /&gt;&lt;br /&gt;1. The application server gets XAResource objects from two different connections:&lt;br /&gt;// XAConA connects to resource manager A&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;javax.transaction.xa.XAResource resourceA = XAConA.getXAResource();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;// XAConB connects to resource manager B&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;javax.transaction.xa.XAResource resourceB = XAConB.getXAResource();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE  Getting the XAResource object from an XAConnection object&lt;br /&gt;&lt;br /&gt;2. The application server passes the XAResource objects to the transaction manager.&lt;br /&gt;The transaction manager does not access the associated XAConnection objects&lt;br /&gt;directly.&lt;br /&gt;3. The transaction manager uses the XAResource objects to assign a piece of the&lt;br /&gt;transaction to each of the associated resource managers. The transaction is&lt;br /&gt;identified by xid, which represents the identifier generated by the transaction&lt;br /&gt;manager when the transaction is created.&lt;br /&gt;&lt;br /&gt;// Send work to resource manager A. The TMNOFLAGS argument indicates&lt;br /&gt;// we are starting a new branch of the transaction, not joining or&lt;br /&gt;// resuming an existing branch.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceA.start(xid, javax.transaction.xa.TMNOFLAGS);&lt;/span&gt;&lt;br /&gt;// do work with resource manager A&lt;br /&gt;...&lt;br /&gt;// tell resource manager A that it’s done, and no errors have occurred&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceA.end(xid, javax.transaction.xa.TMSUCCESS);&lt;/span&gt;&lt;br /&gt;// do work with resource manager B.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;resourceB.start(xid, javax.transaction.xa.TMNOFLAGS);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;// B’s part of the distributed transaction&lt;br /&gt;...&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceB.end(xid, javax.transaction.xa.TMSUCCESS);&lt;/span&gt;&lt;br /&gt;CODE EXAMPLE   Starting and ending transaction branches using the XAResource interface&lt;br /&gt;4. The transaction manager initiates the two-phase commit protocol by asking each participant to vote:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceA.prepare(xid);&lt;br /&gt;resourceB.prepare(xid);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE  Initiating two-phase commit A participating resource manager can vote to roll back the transaction by throwing a javax.transaction.xa.XAException.&lt;br /&gt;&lt;br /&gt;5. If both participants vote to commit, the transaction manager tells each one to commit its piece of the distributed transaction (the second parameter tells the resource manager not to use a one phase commit protocol on behalf of the xid):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceA.commit(xid, false);&lt;br /&gt;resourceB.commit(xid, false);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE             Committing the distributed transaction&lt;br /&gt;&lt;br /&gt;6. If either resource manager votes to roll back, the transaction manager tells each one to roll back its piece of the transaction:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;resourceA.rollback(xid);&lt;br /&gt;resourceB.rollback(xid);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE        Rolling back the distributed transaction The transaction manager is not required to use the same XAResource object to commit/rollback a transaction branch as was used to execute the branch. If different XAResource objects are used, however, they must be associated with XAConnection objects that connect to the same resource manager.&lt;br /&gt;Note – Steps 1-6 also apply to the case where XAConA and XAConB are two physical&lt;br /&gt;connections to the same resource manager.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Closing the Connection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In a typical distributed transaction environment, the middle-tier server needs to be notified when an application has finished using a connection. As in the earlier discussion of PooledConnection objects, the middle-tier server will add itself as a ConnectionEventListener so that it will be notified when the application calls the method Connection.close. At this point, the server will notify the transaction manager so that it can end the transaction branch for the corresponding XAResource object. If the server’s DataSource implementation includes connection pooling, the connection pooling module will be notified that it can return the physical XAConnection object to the pool.&lt;br /&gt;&lt;br /&gt;Note – A distributed transaction may still be active after a participating Connection object is closed. This is not true for local transactions.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Limitations of the XAResource Interface&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The javax.transaction.xa.XAResource interface is limited to defining only the set of methods needed to join and participate in global transactions, as defined by the X/Open XA standard. This allows any resource manager that implements the interface to participate with any other resource manager or transaction manager that has the same level of support. Functionality that is not defined in the X/Open standard is correspondingly not defined in the XAResource interface. Resource managers that provide for support of features not defined in the X/Open XA standard, such as setting isolation levels in global transactions, will have to do so in an implementation-defined way. Users who use implementation-defined features should be aware that they will limit the portability of their applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-2261835091644453776?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/2261835091644453776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=2261835091644453776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2261835091644453776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/2261835091644453776'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/distributed-transactionsjava3.html' title='Distributed Transactions::JAVA-JDBC3'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-7285336742735774123</id><published>2007-11-12T05:52:00.000-08:00</published><updated>2007-11-12T08:35:39.554-08:00</updated><title type='text'>Statement::JAVA-JDBC1</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;The Statement Interface&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The Statement interface defines methods for executing SQL statements that do not&lt;br /&gt;contain parameter markers. The PreparedStatement interface adds methods for&lt;br /&gt;setting input parameters, and the CallableStatement interface adds methods for&lt;br /&gt;retrieving output parameter values returned from stored procedures.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; Creating Statements&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Statement objects are created by Connection objects, as is done in&lt;br /&gt;CODE EXAMPLE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Connection conn = dataSource.getConnection(user, passwd);&lt;br /&gt;Statement stmt = conn.createStatement()&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE           Creating a Statement object Each Connection object can create multiple Statement objects that may be usedconcurrently by the program. This is demonstrated in CODE EXAMPLE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;// get a connection from the DataSource object ds&lt;br /&gt;Connection conn = ds.getConnection(user, passwd);&lt;br /&gt;// create two instances of Statement&lt;br /&gt;Statement stmt1 = conn.createStatement();&lt;br /&gt;Statement stmt2 = conn.createStatement();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE        Creating multiple Statement objects from a single connection'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt; Setting ResultSet Characteristics&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Additional constructors may be used to set the type and concurrency or the type, concurrency, and holdability of any result sets produced by a statement. See&lt;br /&gt;&lt;br /&gt;CODE EXAMPLE         creates a Statement object that returns result sets that are scrollable, that are insensitive to changes made while the ResultSet object is open, that can be updated, and that do not close the ResultSet objects when commit is called.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Connection conn = ds.getConnection(user, passwd);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Statement stmt = conn.createStatement(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ResultSet.TYPE_SCROLL_INSENSITIVE,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ResultSet.CONCUR_UPDATABLE,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ResultSet.HOLD_CURSOR_OVER_COMMIT);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;CODE EXAMPLE            Creating a scrollable, insensitive, updatable result set that stays open&lt;br /&gt;after the method commit is called&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Executing Statement Objects&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The method used to execute a Statement object depends on the type of SQL statement being executed. If the Statement object represents an SQL query returning a ResultSet object, the method executeQuery should be used. If the SQL is known to be a DDL statement or a DML statement returning an update count, the method executeUpdate should be used. If the type of the SQL statement is not known, the method execute should be used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Returning a ResultSet object&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       shows the execution of an SQL string returning a ResultSet object.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Statement stmt = conn.createStatement();&lt;br /&gt;ResultSet rs = stmt.executeQuery(“select TITLE, AUTHOR, ISBN " +&lt;br /&gt;"from BOOKLIST”);&lt;br /&gt;while (rs.next()){&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE        Executing a Statement object that returns a ResultSet object If the SQL string being executed does not return a ResultSet object, the method executeQuery throws an SQLException.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Returning an Update Count&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In CODE EXAMPLE          the SQL statement being executed returns the number of rows affected by the update.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Statement stmt = conn.createStatement();&lt;br /&gt;int rows = stmt.executeUpdate(“update STOCK set ORDER = ‘Y’ " +&lt;br /&gt;"where SUPPLY = 0”);&lt;br /&gt;if (rows &gt; 0) {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE         Executing a Statement object that returns an update count The method executeUpdate throws an SQLException if the SQL string being executed does not return an update count.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Using the Method execute&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The method execute should be used only when the SQL string being executed could return either an update count or a ResultSet object. The execute method returns true if the first result is a ResultSet object and false if it is an update count. Additional methods must be called to retrieve the ResultSet object or update count or to retrieve additional results, if any.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;String sql;&lt;br /&gt;...&lt;br /&gt;Statement stmt = conn.createStatement();&lt;br /&gt;boolean b = stmt.execute(sql);&lt;br /&gt;if (b == true) {&lt;br /&gt;// b is true if a ResultSet is returned&lt;br /&gt;ResultSet rs;&lt;br /&gt;rs = stmt.getResultSet();&lt;br /&gt;while (rs.next()) {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;} else {&lt;br /&gt;// b is false if an update count is returned&lt;br /&gt;int rows = stmt.getUpdateCount();&lt;br /&gt;if (rows &gt; 0) {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE       Executing a Statement object that may return an update count or a ResultSet object When the SQL string being executed returns a ResultSet object, the method&lt;br /&gt;getUpdateCount returns -1. If the SQL string being executed returns an update&lt;br /&gt;count, the method getResultSet returns null.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Closing Statement Objects&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;An application calls the method Statement.close to indicate that it has finished processing a statement. All Statement objects will be closed when the connection that created them is closed. However, it is good coding practice for applications to close statements as soon as they have finished processing them. This allows any external resources that the statement is using to be released immediately. Closing a Statement object will close and invalidate any instances of ResultSet produced by that Statement object. The resources held by the ResultSet object&lt;br /&gt;may not be released until garbage collection runs again, so it is a good practice to explicitly close ResultSet objects when they are no longer needed. These comments about closing Statement objects apply to PreparedStatement and CallableStatement objects as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6594522765263851820-7285336742735774123?l=computerpreferedcourses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://computerpreferedcourses.blogspot.com/feeds/7285336742735774123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6594522765263851820&amp;postID=7285336742735774123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7285336742735774123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6594522765263851820/posts/default/7285336742735774123'/><link rel='alternate' type='text/html' href='http://computerpreferedcourses.blogspot.com/2007/11/statementjava1.html' title='Statement::JAVA-JDBC1'/><author><name>adds</name><uri>http://www.blogger.com/profile/08690543948986695742</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6594522765263851820.post-1321828704529980185</id><published>2007-11-11T08:43:00.000-08:00</published><updated>2007-11-12T08:43:35.902-08:00</updated><title type='text'>Statements::JAVA-JDBC2</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;The PreparedStatement Interface&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The PreparedStatement interface extends Statement, adding the ability to set values for parameter markers contained within the statement. PreparedStatement objects represent SQL statements that can be prepared, or precompiled, for execution once and then executed mulitple times. Parameter markers, represented by “?” in the SQL string, are used to specify input vaues to the statement that may vary at runtime.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Creating a PreparedStatement Object&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An instance of PreparedStatement is created in the same manner as a Statement&lt;br /&gt;object, except that the SQL command is supplied when the statement is created:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Connection conn = ds.getConnection(user, passwd);&lt;br /&gt;PreparedStatement ps = conn.prepareStatement(“INSERT INTO BOOKLIST" +&lt;br /&gt;"(AUTHOR, TITLE, ISBN) VALUES (?, ?, ?)”);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE    Creating a PreparedStatement object with three placeholder markers&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;br /&gt;Setting ResultSet Characteristics&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;As with createStatement, the method prepareStatement defines a constructor&lt;br /&gt;that can be used to specify the characteristics of result sets produced by that&lt;br /&gt;prepared statement.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;Connection conn = ds.getConnection(user, passwd);&lt;br /&gt;PreparedStatement ps = conn.prepareStatement(&lt;br /&gt;“SELECT AUTHOR, TITLE FROM BOOKLIST WHERE ISBN = ?”,&lt;br /&gt;ResultSet.TYPE_FORWARD_ONLY,&lt;br /&gt;ResultSet.CONCUR_UPDATABLE);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE     Creating a PreparedStatement object that returns forward only, updatable result sets&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Setting Parameters&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The PreparedStatement interface defines setter methods that are used to substitute values for each of the parameter markers in the precompiled SQL string. The names of the methods follow the pattern "set&lt;type&gt;". For example, the method setString is used to specify a value for a parameter&lt;br /&gt;marker that expects a string. Each of these setter methods takes at least two parameters. The first is always an int equal to the ordinal position of the parameter to be set, starting at 1. The second and any remaining parameters specify the valueto be assigned to the parameter.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;PreparedStatement ps = conn.prepareStatement(“INSERT INTO BOOKLIST" +&lt;br /&gt;"(AUTHOR, TITLE, ISBN) VALUES (?, ?, ?)”);&lt;br /&gt;ps.setString(1, “Zamiatin, Evgenii”);&lt;br /&gt;ps.setString(2, “We”);&lt;br /&gt;ps.setLong(3, 0140185852);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;CODE EXAMPLE           Setting parameters in a PreparedStatement object A value must be provided for each parameter marker in the PreparedStatement object before it can be executed. The methods used to execute a PreparedStatement object (executeQuery, executeUpdate and execute) will throw an SQLException if a value is not supplied for a parameter marker.&lt;br /&gt;The values set for the parameter markers of a PreparedStatement object are not reset when it is executed. The method clearParameters can be called to explictly clear the values that have been set. Setting a parameter with a different value will replace the previous value with the new one.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Type Conversions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The data type specified in a PreparedStatement setter method is a data type in&lt;br /&gt;the Java programming language. The JDBC driver is responsible for mapping this to&lt;br /&gt;the corresponding JDBC type (one of the SQL types defined in java.sql.Types) so&lt;br /&gt;that it is the appropriate type to be sent to the data source. The default mapping is&lt;br /&gt;specified in Appendix B TABLE B-2.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Type Conversions Using the Method setObject&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The method setObject can be used to convert an object in the Java programming language to a JDBC type.  The conversion is explicit when setObject is passed a Java Object and a JDBC data type. The driver will attempt to convert the Object to the specified JDBC type before passing it to the data source. If the object cannot be converted to the target type, an SQLException object is thrown.&lt;br /&gt;&lt;br /&gt;In CODE EXAMPLE  a Java Object of type Integer is being converted to the JDBC type SHORT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Integer value = new Integer(15);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ps.setObject(1, value, java.sql.Types.SHORT);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CODE EXAMPLE 13-10 Converting an Integer object to an SQL SHORT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;If setObject is called without a type parameter, the Java Object is implicitly&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mapped using the default mapping for that object type.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Integer value = new Integer(15);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;// value is mapped to java.sql.Types.INTEGER&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ps.setObject(1, value);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;CODE EXAMPLE    The method setObject using the default mapping The default mapping is described in Appendix B TABLE B-4&lt;br /&gt;&lt;br /&gt;Note – The method setObject will do custom mapping for SQL UDTs that have a&lt;br /&gt;custom mapping. See Chapter 17 “Customized Type Mapping” for more&lt;br /&gt;information.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Setting NULL Parameters&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The method setNull can be used to set any parameter to JDBC NULL. It takes two&lt;br /&gt;parameters, the ordinal position of the parameter marker, and the JDBC type of the&lt;br /&gt;parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;ps.setNull(2, java.sql.Types.VARCHAR);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;CODE EXAMPLE Setting a String parameter to JDBC NULL If a Java null is passed to any of the setter methods that take a Java object, the parameter will be set to JDBC NULL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);font-size:100%;" &gt;Describing Outputs and Inputs of a PreparedStatement Object&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The method PreparedStatement.getMetaData retrieves a ResultSetMetaData object containing a description of the columns that will be returned by a prepared statement when is it executed. The ResultSetMetaData object contains a record for each column being returned. Methods in the ResultSetMetaData interface provide information about the number of columns&lt;br /&gt;being returned and the characteristics of each column.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PreparedStatement pstmt = conn.prepareStatement(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;"SELECT * FROM CATALOG");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ResultSetMetaData rsmd = pstmt.getMetaData();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;int colCount = rsmd.getColumnCount();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;int colType;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;String colLabel;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;for (int i = 1; i &lt;= colCount; i++) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;colType = rsmd.getColumnType(i);&lt;/span&gt;&lt;br /&gt;
