Order the Book

coreservlets
Class PreparedStatements

java.lang.Object
  |
  +--coreservlets.PreparedStatements

public class PreparedStatements
extends Object

An example to test the timing differences resulting from repeated raw queries vs. repeated calls to prepared statements. These results will vary dramatically among database servers and drivers. With my setup and drivers, Oracle prepared statements took only half the time that raw queries required when using a modem connection, and took only 70% of the time that raw queries required when using a fast LAN connection. Sybase times were identical in both cases.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Constructor Summary
PreparedStatements()
           
 
Method Summary
static void doRawQueries(Connection conn, boolean print)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreparedStatements

public PreparedStatements()
Method Detail

main

public static void main(String[] args)

doRawQueries

public static void doRawQueries(Connection conn,
                                boolean print)

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive