Hello World 77 ResultSetHoldability This parameter is not (Struts web hosting)

Hello World 77 ResultSetHoldability This parameter is not implemented in Connector/J s implementation of createStatement(). When you re using the createStatement() methods, you include the parameters when you re creating a ResultSet or use the defaults as appropriate. In most cases, you use createStatement() without any parameters. Executing SQL Now that we have a Statement object, it s time to execute the SQL statements designed to return results for use in our application. The Statement object includes several types of query methods, as shown in Appendix B. In this section, we cover the method executeQuery(), which is designed to execute SQL that will return a result. This means the method expects to execute a SELECT query. In our example code, the following line sets off the process of retrieving results from the database: ResultSet rs = statement.executeQuery(”SELECT * FROM acc_acc”); There are a few things you should note about this code. The first is that the SQL query statement is provided to the executeQuery() method as a String. The object passes the query to the database, which in turn executes it. Connector/J doesn t, and shouldn t, make any type of determination on the validity of the SQL being passed by the application. If the database is unable to execute the SQL, a SQLException exception will be thrown. If the command is successful, the executeQuery() method returns a ResultSet object containing the rows from the database. Ultimately, three outcomes can occur when the executeQuery() method executes. The first is an exception. An exception can occur for many reasons, among them are the following: The connection is no longer valid to the database server. The SQL has a syntax error in it. The currently logged-in user doesn t have permission to the database table used in the SQL. You need to wrap your executeQuery() in a try/catch block, but it will be a design issue as to which errors you attempt to recover from and which allow the application to fail. There are some database operation errors that you recover from by changing the nature of the operation you might be able to connect to a secondary database, or limit the results. Other errors may be catastrophic, like being unable to update the database. The second outcome is a ResultSet with results in it. This is the most favorable outcome. The third
Note: If you are looking for reliable and quality webspace company to host and run your servlet application check professional servlet hosting services

Comments are closed.