Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
486
Chapter 18 JDBC and Database Connection Pooling
Listing 18.12 EmployeeTest2 result (connecting to Sybase on NT)
Prompt> java coreservlets.EmployeeTest2 dbhost2 605741 
        hall xxxx sybase
  
    
    
    
    
    
    
    
    
    
idfirstnamelastnamelanguagesalary
  
1WyeTukayCOBOL42500.0
  
2BrittTellC++62000.0
  
3MaxManagernone15500.0
  
4PollyMorphicSmalltalk51500.0
  
5FrankFunctionCommon Lisp51500.0
  
6JustinTimecompilerJava98000.0
  
7SirVletJava114750.0
  
8JayEspyJava128500.0
Listing 18.13 EmployeeCreation.java 
package coreservlets;
import java.sql.*;
/** Make a simple "employees" table using DatabaseUtilities. */
public class EmployeeCreation {
  public static Connection createEmployees(String driver,
                                           String url,
                                           String username,
                                           String password,
                                           boolean close) {
    String format =
      "(id int, firstname varchar(32), lastname varchar(32), " +
      "language varchar(16), salary float)";
    String[] employees =
      {"(1, 'Wye', 'Tukay', 'COBOL', 42500)",
       "(2, 'Britt', 'Tell',   'C++',   62000)",
       "(3, 'Max',  'Manager', 'none',  15500)",
       "(4, 'Polly', 'Morphic', 'Smalltalk', 51500)",
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




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

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