Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

More Java Pitfalls Share Reactor - Daconta M,C.

Daconta M,C. More Java Pitfalls Share Reactor - Wiley publishing, 2003. - 476 p.
ISBN: 0-471-23751-5
Download (direct link): morejavapitfallssharereactor2003.pdf
Previous << 1 .. 34 35 36 37 38 39 < 40 > 41 42 43 44 45 46 .. 166 >> Next

328 ** SQL - table creation, population and deletion
329 *****************************************************-- >
330
331 <target name="createMySQLCacheTables"> 2
333 <sql driver="${driver}" url="${url}" userid="${userid}"
password=" ${password}">
334 <classpath>
335 <fileset dir=".">
336 <include name="mm.mysql-2.0.4-bin.jar" />
337 </fileset>
338 </classpath>
339
340 <!--
341 NOTE: Could logon to MySQL thru URL mysql 2
(default database) and create the States dB instance 2
342 or do this manually through this step: create database
States;
343 -- >
345 CREATE TABLE GeneralInfo (
346 State VARCHAR(40) NOT NULL,
347 Flower VARCHAR(50),
348 Bird VARCHAR(50),
349 Capital VARCHAR(40),
350 PRIMARY KEY(State)
351 ) ;
352
353 CREATE TABLE Topics (
354 State VARCHAR(40) NOT NULL,
355 AutomobileDealers VARCHAR(40),
356 BikeTrails VARCHAR(50),
357 Gyms VARCHAR(50),
358 Hospitals VARCHAR(50),
359 Laundromats VARCHAR(50),
360 Parks VARCHAR(50),
361 Physicians VARCHAR(50),
362 PetStores VARCHAR(50),
363 Restaurants VARCHAR(50),
364 RestAreas VARCHAR(50),
365 Supermarkets VARCHAR(50),
366 PRIMARY KEY(State)
367 );
369 </sql>
371 </target>
372
373 <target name="dropMySQLCacheTables"> 2
375 <sql driver="${driver}" url="${url}" userid="${userid}"
password=" ${password}">
376 <classpath>
377 <fileset dir=".">
378 <include name="mm.mysql-2.0.4-bin.jar" />
379 </fileset>
Listing 11.1 (continued)
98 Item 11
380 </classpath>
382 DROP TABLE GeneralInfo;
383 DROP TABLE Topics;
385 </sql>
386 </target>
387
388 <target name="populateMySQLCacheTables">
390 <sql driver="${driver}" url="${url}" userid="${userid}"
password="${password}">
391 <classpath>
392 <fileset dir=".">
393 <include name="mm.mysql-2.0 4-bin.jar" />
394 </fileset>
395 </classpath>
396
397 INSERT INTO GeneralInfo VALUES ('Alabama', 'Camellia', 2
'Yellowhammer', 'Montgomery');
399 INSERT INTO Topics VALUES ('Alabama', 'KIA , 'Bama Path',
'Mr Muscles', 'St. Lukes', 'Mr. Clean', 'Tuscaloosa', 'Dr. Nick', 'Mr.
Pickles', 'Joes Pizzaria', 'Selma', 'Mr. Goodshoes');
401 </sql>
402 </target>
Listing 11.1 (continued)
The key to having efficient operations during development is predicated on the automation of tedious operations, especially testing. An open-source offering called CruiseControl can be embedded in Ant scripts to allow developers to check out source code from CVS so that release builds can be made and modules can be tested. This is an important component of all software operations. Batch scripts can be used to create nightly builds with CruiseControl so that daily software modifications can be tested for defects overnight and addressed by developers before they are forgotten and remain undetected on a system.
404
405
406
407
408
<!--
********************************************************
** Cruise control *****************************************************-- > <target name="all" depends="clean, compile, javadoc, 2
distribute, junit" description="prepare application for CruiseControl"/> 410: <target name="cruise" description="Start the automated build 2 process with CruiseControl">
412: <copy todir="${catalina.home}/webapps/" 2
file="Cruisecontrol/cruisecontrol/buildservlet.war" />
414: <java classname="net.sourceforge.cruisecontrol.MasterBuild" 2
fork="yes" >
415: <arg line="-properties cruisecontrol.properties - 2
lastbuild 20020901010101 -label test 1"/>
416: <classpath>
Listing 11.1 (continued)
Apache Ant and Lifecycle Management 99
417 <pathelement 2
location="Cruisecontrol\cruisecontrol\cruisecontrol.jar"/>
418 <pathelement path="${java.class.path}"/>
419 <pathelement path="${compile.classpath}"/>
420 <pathelement location="."/>
421 </classpath>
422 </java>
424 </target>
425
426 <target name="checkout" description="Update package from CVS >
427 <cvs cvsroot="${cvs.repository}" package="${cvs.package}" 2
dest="." passfile="etc\.passwd" />
428 </target>
429
430 <target name="modificationcheck" depends="prepare" 2
description="Check modifications since last build">
431
432 <taskdef name="modificationset"
classname="net.sourceforge.cruisecontrol.ModificationSet"/>
433 <echo message="Checking for modifications..."/> 2
434 <modificationset lastbuild="${lastGoodBuildTime}"
quietperiod="30" dateformat="yyyy-MMM-dd HH:mm:ss"> 2
435 <cvselement cvsroot="${cvs.repository}"
localworkingcopy="." />
436 </modificationset>
437 </target>
438
439 <target name="masterbuild" 2
depends="modificationcheck,checkout,all" description="Cruise Control 2
master build"/> 2
440 <target name="cleanbuild" depends="clean,masterbuild"
description="Cruise Control clean build"/>
442 </project>
Listing 11.1 (continued)
Let's face it, the Internet has made it difficult for all software companies to keep up with platform and tool evolutions. Many integrated development environments (IDEs), both proprietary and open-source, have implemented Ant in their applications, but disparities in Ant versions and proprietary tag extensions in these applications have made these tools less desirable for application builds and deployments. These inconsistencies make Ant a much more powerful tool when run from the command line and not from an IDE application that could introduce incompatibility problems.
Previous << 1 .. 34 35 36 37 38 39 < 40 > 41 42 43 44 45 46 .. 166 >> Next