![]() |
Deploying Cloudscape Applications
|
Reference Manual |
Creating Cloudscape Databases for Read-Only UseYou can create Cloudscape databases for use on read-only media such as CD-ROMs. Cloudscape databases in zip or jar files are also read-only databases. Typically, read-only databases are deployed with an application in an embedded environment.
Creating and Preparing the Database for Read-Only UseTo create databases for use on read-only media:
Deploying the Database on the Read-Only Media
Transferring Read-Only Databases to Archive (Jar or Zip) FilesOnce a database has been created in Cloudscape, it can be stored in a jar or zip file and continue to be accessed by Cloudscape in read-only mode. This allows a read-only database to be distributed as a single file instead of as multiple files within a directory and to be compressed. In fact, a jar or zip file can contain any number of Cloudscape databases and can also contain other information not related to Cloudscape, such as application data or code. You cannot store the cloudscape.properties file in a jar or zip file. To create a jar or zip file containing one or more Cloudscape databases:
Accessing a Read-Only Database in a Zip/JarTo access a database in a zip/jar, you specify jar in the subsubprotocol: jdbc:cloudscape:jar:(pathToArchive)databasePathWithinArchive The pathToArchive is the absolute path to the archive file. The databasePathWithinArchive is the relative path to the database within the archive. For example: jdbc:cloudscape:jar:(C:/dbs.jar)products/boiledfood jdbc:cloudscape:jar:(C:/dbs.jar)sales If you have trouble finding a database within an archive, check the contents of the archive using your archive tool. The databasePathWithinArchive must match the one in the archive. You may find that the path in the archive has a leading slash, and thus the URL would be: jdbc:cloudscape:jar:(C:/dbs.jar)/products/boiledfood Databases in a jar or zip file are always opened read-only and there is currently no support to allow updates of any type. Databases in a jar or zip file are not booted automatically when Cloudscape is started, unless they are explicitly listed as cloudscape.service properties. Accessing Databases-in-a-Jar in the Class PathOnce an archive containing one or more Cloudscape databases has been created it can be placed in the class path. This allows access to a database from within an application without the application's knowing the path of the archive. When jar or zip files are part of the class path, you do not have to specify the jar subsubprotocol to connect to them. To access a database in a zip or jar file in the class path:
jdbc:cloudscape:/products/boiledfood jdbc:cloudscape:classpath:/products/boiledfood When Path Is Ambiguous with Databases in File SystemUse the basic database connection URL syntax only if the database path specified does not also point to a Cloudscape database in the file system. If this is the case, the connection attempt may fail or connect to the wrong database. Use the form of the syntax with the subsubprotocol to distinguish between the databases. jdbc:cloudscape:classpath:/products/boiledfood When Path Is Ambiguous Because of Databases in Class PathTo connect to a database in the file system when the database connection URL that you would use would be ambiguous with a database in the class path, use the following form of the database connection URL: jdbc:cloudscape:directory:databasePathInFileSystem jdbc:cloudscape:directory:/products/boiledfood Apart from the database connection URL, databases in archives in the class path behave just like databases in archives accessed through the file system. However, databases in archives are read-only. Read-Only Databases and UpgradingUpgrading requires that databases be on read-write media. Both major and minor revisions of Cloudscape--such as those between version 2 and 3 and those between 1 and 2--involve upgrading databases. Maintenance revisions--such as those between 1.5.1 and 1.5.2--also involve an upgrade step: Stored prepared statements are recompiled. To upgrade, transfer the database to read-write media, connect with the new version of Cloudscape, then retransfer to read-only media. NOTE: To avoid upgrade problems, distribute the version of the Cloudscape software appropriate for the database on the read-only media along with the application and the database. Databases on Read-Only Media and DatabaseMetaDataDatabases on read-only media return true for DatabaseMetaData.isReadOnly. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |