<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>J2ee Web Hosting - Java and JBoss Server Pages</title>
	<link>http://jboss.virtualwebstudio.com</link>
	<description>Welcome To The JBoss Comunity</description>
	<pubDate>Sat, 12 Jan 2008 19:16:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/12/151/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/12/151/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 19:16:48 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/12/151/</guid>
		<description><![CDATA[into the requested data type. Null values are handled specially; the JDBC API has a  wasNull method that will return true if the last column that was retrieved was null:   public boolean wasNull()    throws SQLException   {    return lastNull;   }   The [...]]]></description>
			<content:encoded><![CDATA[<p>into the requested data type. Null values are handled specially; the JDBC API has a  wasNull method that will return true if the last column that was retrieved was null:   public boolean wasNull()    throws SQLException   {    return lastNull;   }   The SimpleText driver also supports InputStreams. In our case, the  SimpleTextInputStream class is just a simple wrapper around a CommonValue object.  Thus, if an application requests the data for a column as an InputStream, the SimpleText  driver will get the data as a CommonValue object (as it always does) and create an  InputStream that fetches the data from the CommonValue.   The getMetaData method returns a ResultSetMetaData object, which is our last class to  cover.   ResultSetMetaData   The ResultSetMetaData class provides methods that describe each one of the columns in  a result set. This includes the column count, column attributes, and the column name.  ResultSetMetaData will typically be the smallest class in a JDBC driver, and is usually  very straightforward to implement. For the SimpleText driver, all of the necessary  information is retrieved from the Hashtable of column information that is required for all  result sets. Thus, to retrieve the column name:   public String getColumnLabel(    int column)    throws SQLException   {    // Use the column name    return getColumnName(column);   }      protected SimpleTextColumn getColumn(    int col)    throws SQLException   {    SimpleTextColumn column = (SimpleTextColumn)    inMemoryColumns.get(new Integer(col));       if (column == null) {    throw new SQLException(&#8221;Invalid column number: &#8221; + col);    }       return column;    <br />Find the right website host for you, offering a directory of website hosts, free domain name registration tool, hosting reviews, web hosting ratings and articles for beginners, and tons of other resources, check <a href="http://www.virtualwebstudio.com">web hosting ratings</a> for more information.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/12/151/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/11/150/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/11/150/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 22:57:50 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/11/150/</guid>
		<description><![CDATA[object, and the application can request it in any other supported format. Let s take a look  at the getString method:   public String getString(    int columnIndex)    throws SQLException   {    // Verify the column and get the absolute column number for the [...]]]></description>
			<content:encoded><![CDATA[<p>object, and the application can request it in any other supported format. Let s take a look  at the getString method:   public String getString(    int columnIndex)    throws SQLException   {    // Verify the column and get the absolute column number for the    // table.    int colNo = verify(columnIndex);       String s = null;       if (inMemoryRows != null) {    s = (getColumn(rowNum, columnIndex)).getString();    }    else {    CommonValue value = getValue(colNo);       if (value != null) {    s = value.getString();    }    }    if (s == null) {    lastNull = true;    }       return s;   }      The method starts out by verifying that the given column number is valid. If it is not, an  exception is thrown. Some other types of initialization are also performed. Remember  that all ResultSet objects are provided with a Hashtable of SimpleTextColumn objects  describing each column:   protected int verify(    int column)    throws SQLException   {    clearWarnings();    lastNull = false;       SimpleTextColumn col = (SimpleTextColumn) inMemoryColumns.get(    new Integer(column));       if (col == null) {    throw new SQLException(&#8221;Invalid column number: &#8221; + column);    }    return col.colNo;   }   Next, if the row data is stored in an in-memory Hashtable (as with the  DatabaseMetaData catalog methods), the data is retrieved from the Hashtable.  Otherwise, the driver gets the data from the data file. In both instances, the data is  retrieved as a CommonValue object, and the getString method is used to format the data    <br />You need web hosting, easy to use web template and great support. What else could I ask for?All of our reseller accounts include free web hosting templates just check <a href="http://www.virtualwebstudio.com">web hosting templates</a> for more information.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/11/150/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/10/149/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/10/149/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 02:18:57 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/10/149/</guid>
		<description><![CDATA[they were not necessary; if an application wanted to get data in this manner, then the  application could provide a routine to cross reference the column name to a column  number. Unfortunately (in my opinion), JavaSoft chose to keep these methods in the API  and provide the implementation of the cross reference [...]]]></description>
			<content:encoded><![CDATA[<p>they were not necessary; if an application wanted to get data in this manner, then the  application could provide a routine to cross reference the column name to a column  number. Unfortunately (in my opinion), JavaSoft chose to keep these methods in the API  and provide the implementation of the cross reference method in an appendix. Because it  is part of the API, all drivers must implement the methods. Implementing the methods is  not all that difficult, but it is tedious and adds overhead to the driver. The driver simply  takes the column name that is given, gets the corresponding column number for the  column name, and invokes the same get method using the column number:   public String getString(    String columnName)    throws SQLException   {    return getString(findColumn(columnName));   }   And here s the findColumn routine:   public int findColumn(    String columnName)    throws SQLException   {    // Make a mapping cache if we don&#8217;t already have one    if (md == null) {    md = getMetaData();    s2c = new Hashtable();    }    // Look for the mapping in our cache    Integer x = (Integer) s2c.get(columnName);       if (x != null) {    return (x.intValue());    }       // OK, we&#8217;ll have to use metadata    for (int i = 1; i < md.getColumnCount(); i++) {    if (md.getColumnName(i).equalsIgnoreCase(columnName)) {       // Success! Add an entry to the cache    s2c.put(columnName, new Integer(i));    return (i);    }    }       throw new SQLException("Column name not found: " + columnName,    "S0022");   }   This method uses a Hashtable to cache the column number and column names.   It s Your Way, Right Away   An application can request column data in any one of the supported JDBC data types. As  we have discussed before, the driver should coerce the data into the proper format. The  SimpleText driver accomplishes this by using a CommonValue object for all data  values. Therefore, the data can be served in any format, stored as a CommonValue    <br />Have you tried other web hosting companies and found out that their focus and your focus are in clash?Check our <a href="http://www.virtualwebstudio.com">filemaker web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/10/149/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/09/148/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/09/148/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 03:09:16 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/09/148/</guid>
		<description><![CDATA[}    }    catch (Exception ex) {    }       throw new SQLException(&#8221;Unknown object type&#8221;);   }   Setting InputStreams   As we ll see with ResultSet later, using InputStreams is the recommended way to work  with long data [...]]]></description>
			<content:encoded><![CDATA[<p>}    }    catch (Exception ex) {    }       throw new SQLException(&#8221;Unknown object type&#8221;);   }   Setting InputStreams   As we ll see with ResultSet later, using InputStreams is the recommended way to work  with long data (blobs). There are two ways to treat InputStreams when using them as  input parameters: Read the entire InputStream when the parameter is set and treat it as a  large data object, or defer the read until the statement is executed and read it in chunks at  a time. The latter approach is the preferred method because the contents of an  InputStream may be too large to fit into memory. Here s what the SimpleText driver  does with InputStreams:   public void setBinaryStream(    int parameterIndex,    java.io.InputStream x,    int length)    throws SQLException   {       // Validate the parameter index    verify(parameterIndex);       // Read in the entire InputStream all at once. A more optimal    // way of handling this would be to defer the read until execute    // time, and only read in chunks at a time.    byte b[] = new byte[length];       try {    x.read(b);    }    catch (Exception ex) {    throw new SQLException(&#8221;Unable to read InputStream: &#8221; +    ex.getMessage());    }       // Set the data as a byte array    setBytes(parameterIndex, b);   }   But wait, this isn t the preferred way! You are correct, it isn t. The SimpleText driver  simply reads in the entire InputStream and then sets the parameter as a byte array. I ll  leave it up to you to modify the driver to defer the read until execute time.   ResultSet   The ResultSet class provides methods to access data generated by a table query. This  includes a series of get methods which retrieve data in any one of the JDBC SQL type  formats, either by column number or by column name. When the issue of providing get  methods was first introduced by JavaSoft, some disgruntled programmers argued that    <br />Adult web hosting has rich experience in providing unique solutions for the customer&#8217;s needs, just check <a href="http://www.virtualwebstudio.com">frontpage web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/09/148/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/08/147/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/08/147/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 03:21:30 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/08/147/</guid>
		<description><![CDATA[clearWarnings();       // The paramCount was set when the statement was prepared    if ((parameterIndex  paramCount)) {    throw new SQLException(&#8221;Invalid parameter number: &#8221; +    parameterIndex);    }       // If the parameter has already [...]]]></description>
			<content:encoded><![CDATA[<p>clearWarnings();       // The paramCount was set when the statement was prepared    if ((parameterIndex <= 0) ||    (parameterIndex > paramCount)) {    throw new SQLException(&#8221;Invalid parameter number: &#8221; +    parameterIndex);    }       // If the parameter has already been set, clear it    if (boundParams.get(new Integer(parameterIndex)) != null) {    boundParams.remove(new Integer(parameterIndex));    }   }      Because the CommonValue class does not yet support all of the JDBC data types, not all  of the set methods have been implemented in the SimpleText driver. You can see,  however, how easy it would be to fully implement these methods once CommonValue  supported all of the necessary data coercion.   What Is It?   Another way to set parameter values is by using the setObject method. This method can  easily be built upon the other set methods. Of interest here is the ability to set an Object  without giving the JDBC driver the type of driver being set. The SimpleText driver  implements a simple method to determine the type of object, given only the object itself:   protected int getObjectType(    Object x)    throws SQLException   {       // Determine the data type of the Object by attempting to cast    // the object. An exception will be thrown if an invalid casting    // is attempted.    try {    if ((String) x != null) {    return Types.VARCHAR;    }    }    catch (Exception ex) {    }       try {    if ((Integer) x != null) {    return Types.INTEGER;    }    }    catch (Exception ex) {    }       try {    if ((byte[]) x != null) {    return Types.VARBINARY;    <br />Sbc yahoo internet provider is a name that we will not do any shame to. We are as good in what we do. Our <a href="http://www.virtualwebstudio.com">sbc yahoo web hosting</a> team will work hard to meet and satisfy all your web hosting needs.Try us out!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/08/147/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/07/146/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/07/146/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 03:12:42 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/07/146/</guid>
		<description><![CDATA[}      // The overloaded executeUpdate on the Statement object (which we   // extend) is not valid for PreparedStatement or CallableStatement   // objects.   public int executeUpdate(    String sql)    throws SQLException   {    throw new SQLException(&#8221;Method [...]]]></description>
			<content:encoded><![CDATA[<p>}      // The overloaded executeUpdate on the Statement object (which we   // extend) is not valid for PreparedStatement or CallableStatement   // objects.   public int executeUpdate(    String sql)    throws SQLException   {    throw new SQLException(&#8221;Method is not valid&#8221;);   }      // The overloaded execute on the Statement object (which we   // extend) is not valid for PreparedStatement or CallableStatement   // objects.   public boolean execute(    String sql)    throws SQLException   {    throw new SQLException(&#8221;Method is not valid&#8221;);   }   Setting Parameter Values   The PreparedStatement class introduces a series of  set  methods to set the value of a  specified parameter. Take the following SQL statement:   INSERT INTO FOO VALUES (?, ?, ?)   If this statement was used in creating a PreparedStatement object, you would need to  set the value of each parameter before executing it. In the SimpleText driver, parameter  values are kept in a Hashtable. The Hashtable contains the parameter number as the  key, and a CommonValue object as the data object. By using a CommonValue object,  the application can set the parameter using any one of the supported data types, and we  can coerce the data into the format that we need in order to bind the parameter. Here s the  code for the setString method:   public void setString(    int parameterIndex,    String x)    throws SQLException   {    // Validate the parameter index    verify(parameterIndex);       // Put the parameter into the boundParams Hashtable    boundParams.put(new Integer(parameterIndex), x);   }   The verify method validates that the given parameter index is valid for the current  prepared statement, and also clears any previously bound value for that parameter index:   protected void verify(    int parameterIndex)    throws SQLException   {       <br />We strive to offer the highest quality service while maintaining a cheap and discount price structure. For your company, ecommerce, or personal web hosting needs, we offer the best solution.Trust us and please check <a href="http://www.alphawebhosting.net">quality web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/07/146/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/06/145/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/06/145/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 04:01:43 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/06/145/</guid>
		<description><![CDATA[cumbersome, but when you consider the alternative of wrapping try&#8230;catch statements  around each operation, this seems like a better solution. Note also that warnings can be  chained together, just like SQLExceptions (for more information on chaining, see the  JDBC Exception Types section earlier in this chapter).   Two (Or More) For [...]]]></description>
			<content:encoded><![CDATA[<p>cumbersome, but when you consider the alternative of wrapping try&#8230;catch statements  around each operation, this seems like a better solution. Note also that warnings can be  chained together, just like SQLExceptions (for more information on chaining, see the  JDBC Exception Types section earlier in this chapter).   Two (Or More) For The Price Of One   Some database systems allow SQL statements that return multiple results (columnar data  or an update count) to be executed. If you are unfortunate enough to be developing a  JDBC driver using one of these database systems, take heart. The JDBC specification  does address this issue. The getMoreResults method is intended to move through the  results. Figuring out when you have reached the end of the results, however, is a bit  convoluted. To do so, you first call getMoreResults. If it returns true, there is another  ResultSet present and you can use getResultSet to retrieve it. If getMoreResults returns  false, you have either reached the end of the results, or an update count exists; you must  call getUpdateCount to determine which situation exists. If getUpdateCount returns -1,  you have reached the end of the results; otherwise, it will return the number of rows  affected by the statement.   The SimpleText driver does not support multiple result sets, so I don t have any example  code to present to you. The only DBMS that I am aware of that supports this is Sybase.  Because there are already multiple JDBC drivers available for Sybase (one of which I  have developed), I doubt you will have to be concerned with getMoreResults. Consider  yourself lucky.   PreparedStatement   The PreparedStatement is used for pre-compiling an SQL statement, typically in  conjunction with parameters, and can be efficiently executed multiple times with just a  change in a parameter value; the SQL statement does not have to be parsed and compiled  each time. Because the PreparedStatement class extends the Statement class, you will  have already implemented a majority of the methods. The executeQuery,  executeUpdate, and execute methods are very similar to the Statement methods of the  same name, but they do not take an SQL statement as a parameter. The SQL statement  for the PreparedStatement was provided when the object was created with the  prepareStatement method from the Connection object. One danger to note here:  Because PreparedStatement is derived from the Statement class, all of the methods in  Statement are also in PreparedStatement. The three execute methods from the  Statement class that accept SQL statements are not valid for the PreparedStatement  class. To prevent an application from invoking these methods, the driver should also  implement them in PreparedStatement, as shown here:   // The overloaded executeQuery on the Statement object (which we   // extend) is not valid for PreparedStatement or CallableStatement   // objects.   public ResultSet executeQuery(    String sql)    throws SQLException   {    throw new SQLException(&#8221;Method is not valid&#8221;);    <br />Do you want something as professional as you are? Well, we are, but our plans are even better, please check <a href="http://www.alphawebhosting.net">Web Hosting SSH</a> and look why we are the best.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/06/145/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/05/144/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/05/144/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 03:10:58 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/05/144/</guid>
		<description><![CDATA[//   // sql an SQL INSERT, UPDATE, or DELETE statement, or an SQL   // statement that returns nothing.   //   // Returns either the row count for INSERT, UPDATE, or DELETE; or 0   // for SQL statements that return nothing.   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;   [...]]]></description>
			<content:encoded><![CDATA[<p>//   // sql an SQL INSERT, UPDATE, or DELETE statement, or an SQL   // statement that returns nothing.   //   // Returns either the row count for INSERT, UPDATE, or DELETE; or 0   // for SQL statements that return nothing.   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;   public int executeUpdate(    String sql)    throws SQLException   {    if (traceOn()) {    trace(&#8221;@executeUpdate(&#8221; + sql + &#8220;)&#8221;);    }    int count = -1;       // Execute the query. If execute returns false, then an update    // count exists.    if (execute(sql) == false) {    count = getUpdateCount();    }    else {    // If the statement does not create an update count, the    // specification indicates that an SQLException should be  raised.    throw new SQLException(&#8221;Statement did not create an update    count&#8221;);    }       return count;   }      As you can see, executeQuery and executeUpdate are simply helper methods for an  application; they are built completely upon other methods contained within the class. The  execute method accepts an SQL statement as its only parameter, and will be implemented  differently, depending upon the underlying database system. For the SimpleText driver,  the SQL statement will be parsed, prepared, and executed. Note that parameter markers  are not allowed when executing an SQL statement directly. If the SQL statement created  results containing columnar data, execute will return true; if the statement created a count  of rows affected, execute will return false. If execute returns true, the application then  uses getResultSet to return the current result information; otherwise, getUpdateCount  will return the number of rows affected.   Warnings   As opposed to SQLException, which indicates a critical error, an SQLWarning can be  issued to provide additional information to the application. Even though SQLWarning is  derived from SQLException, warnings are not thrown. Instead, if a warning is issued, it  is placed on a warning stack with the Statement object (the same holds true for the  Connection and ResultSet objects). The application must then check for warnings after  every operation using the getWarnings method. At first, this may seem a bit    <br />Our unmatched NT experience allows us to provide the most reliable and affordable hosting for our customers, just check <a href="http://www.virtualwebstudio.com">NT Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/05/144/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/04/143/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/04/143/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 03:11:51 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/04/143/</guid>
		<description><![CDATA[handled by the ResultSet class. For now, just note that it can handle both in-memory  results (in the form of a Hashtable) and results read directly from the data file.   Statement   The Statement class contains methods to execute SQL statements directly against the  database and to obtain the results. [...]]]></description>
			<content:encoded><![CDATA[<p>handled by the ResultSet class. For now, just note that it can handle both in-memory  results (in the form of a Hashtable) and results read directly from the data file.   Statement   The Statement class contains methods to execute SQL statements directly against the  database and to obtain the results. A Statement object is created using the  createStatement method from the Connection object. Of note in Listing 10.21 are the  three methods used to execute SQL statements: executeUpdate, executeQuery, and  execute. In actuality, you only need to worry about implementing the execute method;  the other methods use it to perform their work. In fact, the code provided in the  SimpleText driver should be identical for all JDBC drivers.   Listing 10.21 Executing SQL statements.   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;   // executeQuery - JDBC API   // Execute an SQL statement that returns a single ResultSet.   //   // sql Typically this is a static SQL SELECT statement.   //   // Returns the table of data produced by the SQL statement.   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;   public ResultSet executeQuery(    String sql)    throws SQLException   {    if (traceOn()) {    trace(&#8221;@executeQuery(&#8221; + sql + &#8220;)&#8221;);    }       java.sql.ResultSet rs = null;       // Execute the query. If execute returns true, then a result set    // exists.    if (execute(sql)) {    rs = getResultSet();    }    else { // If the statement does not create a ResultSet, the    // specification indicates that an SQLException  should    // be raised.    throw new SQLException(&#8221;Statement did not create a ResultSet&#8221;);    }    return rs;   }      //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;   // executeUpdate - JDBC API   // Execute an SQL INSERT, UPDATE, or DELETE statement. In addition,   // SQL statements that return nothing, such as SQL DDL statements,   // can be executed.    <br />Get account with us and you will get completely access to our free web templates database with over 10.000 templates in it to build your website.Don&#8217;t wait, go and check <a href="http://www.virtualwebstudio.com">free web templates</a>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/04/143/feed/</wfw:commentRSS>
		</item>
		<item>
		<title></title>
		<link>http://jboss.virtualwebstudio.com/2008/01/04/142/</link>
		<comments>http://jboss.virtualwebstudio.com/2008/01/04/142/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 07:02:00 +0000</pubDate>
		<dc:creator>icvetic</dc:creator>
		
	<category>Java and JBoss Server Pages</category>
		<guid isPermaLink="false">http://jboss.virtualwebstudio.com/2008/01/04/142/</guid>
		<description><![CDATA[// name here.    tableEntry = new SimpleTextTable(dir, entries[i]);    list.put(new Integer(i), tableEntry);       }    }       return list;   }   Again, I use a Hashtable for each table (or file in our case) that [...]]]></description>
			<content:encoded><![CDATA[<p>// name here.    tableEntry = new SimpleTextTable(dir, entries[i]);    list.put(new Integer(i), tableEntry);       }    }       return list;   }   Again, I use a Hashtable for each table (or file in our case) that is found. By now, you  will have realized that I really like using Hashtables; they can grow in size dynamically  and provide quick access to data. And because a Hashtable stores data as an abstract  Object, I can store whatever is necessary. In this case, each Hashtable entry for a table  contains a SimpleTextTable object:   public class SimpleTextTable    extends Object   {   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;    // Constructor   //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;    public SimpleTextTable(    String dir,    String file)    {    this.dir = dir;    this.file = file;       // If the filename has the .SDF extension, get rid of it    if (file.endsWith(SimpleTextDefine.DATA_FILE_EXT)) {    name = file.substring(0, file.length() -    SimpleTextDefine.DATA_FILE_EXT.length());    }    else {    name = file;    }    }       public String dir;    public String file;    public String name;   }   Notice that the constructor strips the file extension from the given file name, creating the  table name.   Now, back to the getTables method for DatabaseMetaData. Once a list of all of the  tables has been retrieved, the Hashtable used for storing all of the rows is generated. If  you were to add additional filtering, this is the place that it should be done. Finally, a new  ResultSet object is created and initialized. One of the constructors for the ResultSet class  accepts two Hashtables: one for the column information (SimpleTextColumn objects),  and the other for row data (CommonValue objects). We ll see later how these are    <br />The UK has been a member of the European Union since 1973. The attitude of the present government towards further integration is conservative, with the official opposition favoring a return of some powers and competencies to the UK.From our experience, we can recommend <a href="http://www.alphawebhosting.net">Cheap UK Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://jboss.virtualwebstudio.com/2008/01/04/142/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
