Source Code Cross Referenced for wisconsin.java in  » Database-DBMS » db-derby-10.2 » org » apache » derbyTesting » functionTests » tests » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derbyTesting.functionTests.tests.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        Derby - Class org.apache.derbyTesting.functionTests.tests.lang.wisconsin
004:
005:        Licensed to the Apache Software Foundation (ASF) under one or more
006:        contributor license agreements.  See the NOTICE file distributed with
007:        this work for additional information regarding copyright ownership.
008:        The ASF licenses this file to You under the Apache License, Version 2.0
009:        (the "License"); you may not use this file except in compliance with
010:        the License.  You may obtain a copy of the License at
011:
012:           http://www.apache.org/licenses/LICENSE-2.0
013:
014:        Unless required by applicable law or agreed to in writing, software
015:        distributed under the License is distributed on an "AS IS" BASIS,
016:        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:        See the License for the specific language governing permissions and
018:        limitations under the License.
019:
020:         */
021:        package org.apache.derbyTesting.functionTests.tests.lang;
022:
023:        import java.io.BufferedInputStream;
024:        import java.io.FileInputStream;
025:        import java.io.FileNotFoundException;
026:        import java.sql.Connection;
027:        import java.sql.PreparedStatement;
028:        import java.sql.SQLException;
029:        import java.sql.Statement;
030:
031:        import org.apache.derby.impl.tools.ij.utilMain;
032:        import org.apache.derby.tools.ij;
033:
034:        public class wisconsin {
035:
036:            public static void main(String[] args) throws Throwable {
037:                ij.getPropertyArg(args);
038:                Connection conn = ij.startJBMS();
039:
040:                conn.setAutoCommit(false);
041:                conn
042:                        .setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
043:
044:                createTables(conn);
045:
046:                BufferedInputStream inStream;
047:
048:                // set input stream
049:                String filePath = "wisc_setup.sql";
050:
051:                try {
052:                    inStream = new BufferedInputStream(new FileInputStream(
053:                            filePath), utilMain.BUFFEREDFILESIZE);
054:                } catch (FileNotFoundException e) {
055:                    System.out.println("unable to find input file " + filePath);
056:                    throw e;
057:                }
058:
059:                ij.runScript(conn, inStream, "US-ASCII", System.out,
060:                        (String) null);
061:                conn.commit();
062:            }
063:
064:            private static void createTables(Connection conn)
065:                    throws SQLException {
066:                Statement stmt = conn.createStatement();
067:
068:                stmt
069:                        .execute("create table TENKTUP1 ( unique1 int not null, "
070:                                + "unique2 int not null, "
071:                                + "two int, "
072:                                + "four int, "
073:                                + "ten int, "
074:                                + "twenty int, "
075:                                + "onePercent int, "
076:                                + "tenPercent int, "
077:                                + "twentyPercent int, "
078:                                + "fiftyPercent int, "
079:                                + "unique3 int, "
080:                                + "evenOnePercent int, "
081:                                + "oddOnePercent int, "
082:                                + "stringu1 char(52) not null, "
083:                                + "stringu2 char(52) not null, "
084:                                + "string4 char(52) )");
085:                //--insert 10000 rows into TENKTUP1
086:                WISCInsert wi = new WISCInsert();
087:                wi.doWISCInsert(10000, "TENKTUP1", conn);
088:
089:                stmt
090:                        .execute("create unique index TK1UNIQUE1 on TENKTUP1(unique1)");
091:                stmt
092:                        .execute("create unique index TK1UNIQUE2 on TENKTUP1(unique2)");
093:                stmt.execute("create index TK1TWO on TENKTUP1(two)");
094:                stmt.execute("create index TK1FOUR on TENKTUP1(four)");
095:                stmt.execute("create index TK1TEN on TENKTUP1(ten)");
096:                stmt.execute("create index TK1TWENTY on TENKTUP1(twenty)");
097:                stmt
098:                        .execute("create index TK1ONEPERCENT on TENKTUP1(onePercent)");
099:                stmt
100:                        .execute("create index TK1TWENTYPERCENT on TENKTUP1(twentyPercent)");
101:                stmt
102:                        .execute("create index TK1EVENONEPERCENT on TENKTUP1(evenOnePercent)");
103:                stmt
104:                        .execute("create index TK1ODDONEPERCENT on TENKTUP1(oddOnePercent)");
105:                stmt
106:                        .execute("create unique index TK1STRINGU1 on TENKTUP1(stringu1)");
107:                stmt
108:                        .execute("create unique index TK1STRINGU2 on TENKTUP1(stringu2)");
109:                stmt.execute("create index TK1STRING4 on TENKTUP1(string4)");
110:
111:                stmt.execute("create table TENKTUP2 (unique1 int not null, "
112:                        + "unique2 int not null, " + "two int, " + "four int, "
113:                        + "ten int, " + "twenty int, " + "onePercent int, "
114:                        + "tenPercent int, " + "twentyPercent int, "
115:                        + "fiftyPercent int, " + "unique3 int, "
116:                        + "evenOnePercent int, " + "oddOnePercent int, "
117:                        + "stringu1 char(52), " + "stringu2 char(52), "
118:                        + "string4 char(52) )");
119:                //-- insert 10000 rows into TENKTUP2
120:                wi = new WISCInsert();
121:                wi.doWISCInsert(10000, "TENKTUP2", conn);
122:
123:                stmt
124:                        .execute("create unique index TK2UNIQUE1 on TENKTUP2(unique1)");
125:                stmt
126:                        .execute("create unique index TK2UNIQUE2 on TENKTUP2(unique2)");
127:
128:                stmt.execute("create table ONEKTUP ( unique1 int not null, "
129:                        + "unique2 int not null, " + "two int, " + "four int, "
130:                        + "ten int, " + "twenty int, " + "onePercent int, "
131:                        + "tenPercent int, " + "twentyPercent int, "
132:                        + "fiftyPercent int, " + "unique3 int, "
133:                        + "evenOnePercent int, " + "oddOnePercent int, "
134:                        + "stringu1 char(52), " + "stringu2 char(52), "
135:                        + "string4 char(52) )");
136:
137:                //-- insert 1000 rows into ONEKTUP
138:                wi = new WISCInsert();
139:                wi.doWISCInsert(1000, "ONEKTUP", conn);
140:
141:                stmt
142:                        .execute("create unique index ONEKUNIQUE1 on ONEKTUP(unique1)");
143:                stmt
144:                        .execute("create unique index ONEKUNIQUE2 on ONEKTUP(unique2)");
145:
146:                stmt.execute("create table BPRIME (	 unique1 int, "
147:                        + "unique2 int, " + "two int, " + "four int, "
148:                        + "ten int, " + "twenty int, " + "onePercent int, "
149:                        + "tenPercent int, " + "twentyPercent int, "
150:                        + "fiftyPercent int, " + "unique3 int, "
151:                        + "evenOnePercent int, " + "oddOnePercent int, "
152:                        + "stringu1 char(52), " + "stringu2 char(52), "
153:                        + "string4 char(52))");
154:
155:                stmt
156:                        .execute("insert into BPRIME select * from TENKTUP2 where TENKTUP2.unique2 < 1000");
157:
158:                conn.commit();
159:
160:                PreparedStatement ps2 = conn
161:                        .prepareStatement("call SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
162:                ps2.setString(1, "APP");
163:                ps2.setString(2, "BPRIME");
164:                ps2.setInt(3, 0);
165:                ps2.executeUpdate();
166:                conn.commit();
167:
168:                ps2.setString(1, "APP");
169:                ps2.setString(2, "TENKTUP1");
170:                ps2.setInt(3, 0);
171:                ps2.executeUpdate();
172:                conn.commit();
173:
174:                ps2.setString(1, "APP");
175:                ps2.setString(2, "TENKTUP2");
176:                ps2.setInt(3, 0);
177:                ps2.executeUpdate();
178:                conn.commit();
179:
180:                ps2.setString(1, "APP");
181:                ps2.setString(2, "ONEKTUP");
182:                ps2.setInt(3, 0);
183:                ps2.executeUpdate();
184:                conn.commit();
185:            }
186:
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.