List:Commits« Previous MessageNext Message »
From:tony.bedford Date:June 24 2010 10:58am
Subject:svn commit - mysqldoc@docsrva: r21446 - trunk/sample-programs/connector-j-tutorials
View as plain text  
Author: tbedford
Date: 2010-06-24 12:58:02 +0200 (Thu, 24 Jun 2010)
New Revision: 21446

Log:
Added Sales table

Modified:
   trunk/sample-programs/connector-j-tutorials/SetupTestDatabase.java


Modified: trunk/sample-programs/connector-j-tutorials/SetupTestDatabase.java
===================================================================
--- trunk/sample-programs/connector-j-tutorials/SetupTestDatabase.java	2010-06-23 21:41:30 UTC (rev 21445)
+++ trunk/sample-programs/connector-j-tutorials/SetupTestDatabase.java	2010-06-24 10:58:02 UTC (rev 21446)
Changed blocks: 2, Lines Added: 11, Lines Deleted: 3; 1688 bytes

@@ -67,9 +67,19 @@
             String sql12 = "INSERT INTO Suppliers (supplier_name) VALUES ('IBM');";     // 2
             String sql13 = "INSERT INTO Suppliers (supplier_name) VALUES ('HP');";      // 3
 
-            String [] sql = {sql1, sql2, sql3, sql4, sql5, sql6, sql7, sql8, sql9, sql10, sql11, sql12, sql13};
+            String sql14 =
+                "CREATE TABLE Sales"+  
+                "("+
+                "sales_week TINYINT UNSIGNED PRIMARY KEY NOT NULL DEFAULT 1," +
+                "sales_thisweek FLOAT NOT NULL DEFAULT 0.0,"+
+                "sales_todate FLOAT NOT NULL DEFAULT 0.0"+
+                ")";
 
+            String sql15 = "INSERT INTO Sales (sales_week, sales_thisweek, sales_todate) VALUES (1, 0.0, 0.0)";
 
+            String [] sql = {sql1, sql2, sql3, sql4, sql5, sql6, sql7, sql8, sql9, sql10, sql11, sql12, sql13, sql14, sql15};
+
+
             Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                                                   ResultSet.CONCUR_UPDATABLE);
             int result = runSQL (stmt, sql);

@@ -103,8 +113,6 @@
                 System.out.println(id+"\t\t"+name+"\t\t"+cost+"\t\t"+supplier_id+"\t\t"+supplier_name);
 
             }
-
-
             
         } catch (SQLException ex) {
             System.out.println("SQLException: " + ex.getMessage());


Thread
svn commit - mysqldoc@docsrva: r21446 - trunk/sample-programs/connector-j-tutorialstony.bedford24 Jun