Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
18.5 An Interactive Query Viewer
487
Listing 18.13 EmployeeCreation.java (continued)
"(5, 'Frank', 'Function', 'Common Lisp', 51500)",
"(6, 'Justin', 'Timecompiler', 'Java', 98000)",
"(7, 'Sir', 'Vlet', 'Java', 114750)",
"(8, 'Jay', 'Espy', 'Java', 128500)" };
return(DatabaseUtilities.createTable(driver, url,
username, password,
"employees",
format, employees,
close));
}
public static void main(String[] args) {
if (args.length < 5) {
printUsage();
return;
}
String vendorName = args[4];
int vendor = DriverUtilities.getVendor(vendorName);
if (vendor == DriverUtilities.UNKNOWN) {
printUsage();
return;
}
String driver = DriverUtilities.getDriver(vendor);
String host = args[0];
String dbName = args[1];
String url =
DriverUtilities.makeURL(host, dbName, vendor);
String username = args[2];
String password = args[3];
createEmployees(driver, url, username, password, true);
}
private static void printUsage() {
System.out.println("Usage: EmployeeCreation host dbName " +
"username password oracle|sybase.");
}
}
18.5 An Interactive Query Viewer
Up to this point, all the database results have been based upon queries that
were known at the time the program was written. In many real applications,
however, queries are derived from user input that is not known until runtime.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved