User: janaudy 
  Date: 00/09/13 03:21:05

  Modified:    webstore/db select.java
  Log:
  Fixed a small bug with the command line arguments.
  
  Revision  Changes    Path
  1.2       +20 -17    zola/webstore/db/select.java
  
  Index: select.java
  ===================================================================
  RCS file: /products/cvs/ejboss/zola/webstore/db/select.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- select.java       2000/05/10 14:18:51     1.1
  +++ select.java       2000/09/13 10:21:05     1.2
  @@ -5,32 +5,35 @@
    * @date May, 10, 2000
    * @version 1.0
    */
  - 
  +
   import java.sql.*;
   
   public final class select {
     private static Connection connection = null;
     private static Statement statement = null;
  -  
  +
     public static void main(String _[]) {
       log("Downloading the driver...");
       try {
         Class.forName("org.hsql.jdbcDriver");
  -      connection = DriverManager.getConnection("jdbc:HypersonicSQL:ZOLDB","sa",""); 
 
  +      connection = 
DriverManager.getConnection("jdbc:HypersonicSQL:C:/Telkel/zola/webstore/db/ZOLDB","sa","");
         statement = connection.createStatement();
       } catch (Exception e) {
  -      e.printStackTrace();   
  +      e.printStackTrace();
       }
  -    
  -    
  +
  +
       log ("Products contents...");
  -    
  +
  +    if (_.length == 0)
  +      _ = new String[] {"SELECT * FROM PRODUCTENTITY"};
  +
       log(_[0]);
       seeContents(connection, _[0]);
  -    
  +
       exit();
  -  } 
  -  
  +  }
  +
     private static void exit() {
       log("Closing connection and exiting...");
       try {
  @@ -38,10 +41,10 @@
         connection.close();
         System.exit(1);
       } catch (Exception e) {
  -      e.printStackTrace();   
  +      e.printStackTrace();
       }
     }
  -  
  +
     private static void seeContents(Connection connection, String sql) {
       log("Printing the contents of the database...");
       try {
  @@ -55,16 +58,16 @@
       } catch (Exception e) {
         e.printStackTrace();
       }
  -    
  +
       exit();
     }
  -  
  +
     private static void log(String s) {
  -    System.err.println(s);   
  +    System.err.println(s);
     }
  -  
  +
     private static final String tab = "\t";
  -  
  +
     private static final String PRODUCTENTITY  = "PRODUCTENTITY",
                                 ID             = "ID",  //PK
                                 CATEGORY       = "CATEGORY",
  
  
  

Reply via email to