February 18, 2000

GET and POST Requests

Question: How does a servlet handle GET and POST requests? Answer: The HttpServlet abstract class, defined in the javax.servlet.httppackage, contains several methods that simplify interacting with HTTPrequests. Two of the methods take care of handling GET and POSTrequests. When you write a servlet, you should subclass HttpServletand implement the doGet()

ResultSet Positioning

Question: How can I access the next and previous rows in a ResultSet when Iconnect to a database through a JDBC driver? Answer: The JDBC 1.0 API only allows you to move forward through a ResultSetwith the next() method. The next() will set the ResultSet to point to thenext row

Multiselect Drop-down Box

Question: I need to have a drop-down box (combo probably) which allows multiple selections. The list box does this but there is no room to have the number of list boxes required. Drop-down capability is required. How can this be done? We will create a custom ctl/OCX to do this.

ADO and Large Tables

Question: I have several MS Access97 database tables that are larger than 120 MB. When I use ADO to open the entire table it seems to try to load the table into memory, this crashes the machine it is running on. Is there anyway to limit the amount of memory

Dumping Tables

Question: Using JDBC, how can I turn a database table into a series of SQL INSERT statements that can recreate the table? Answer: Dumping a database table into a set of insert statements is just amatter of selecting all of its rows and constructing insert statementsbased on their column values.

JDBCTest ClassNotFoundException

Question: I’m trying to test the JDBC-ODBC bridge with JDBCTest tool and itgives me the following error: registerDriver() Failed:java.lang.ClassNotFoundException: sun/jdbc/odbc/JdbcOdbcDriver What’s the problem? Answer: It looks like the jar file containing the class is not in your classpath. You should use the JDK 1.2 java -cp option to add the

Enumerate Flags for Easier Coding

If you do a lot of work with the Windows API, you might notice that some API functions have flag-type parameters, and you usually pass API constants as the values for these parameters. Instead of putting multiple Public Const statements in a module the way the API Viewer gives them

No more posts to show