Custom database configuration
The SmartClient object-relational connector supports rapid end-to-end application prototyping and SDK evaluation. To configure this connector for use against a database other than the embedded HSQLDB instance:
1. Install JDBC driver
To install a JDBC driver, copy the downloaded .jar file, or unzip the downloaded .zip file, into your isomorphicSDK\WEB-INF\classes directory.
2. Create 'isomorphic' database
By default, the example applications provided in the SmartClient SDK look for their data in a database named isomorphic. You must create this database and import the sample data in order to use the example applications. Follow your database vendor's instructions for creating new databases and tablespaces.
Alternatively, you may edit the parameters in isomorphicSDK\WEB-INF\classes\server.properties to use an existing database. If you choose to do this, you must edit and save server.properties and restart your servlet container before attempting to import the sample data.
3. Configure SmartClient object-relational connector
The instructions in this section explain how to manually edit your configuration settings. Alternatively, you may use the graphical SmartClient Admin Console to edit these settings. If you are viewing this page from your application server, click here to open the Admin Console. Otherwise, open the console from: http://<your server>:<your port>/isomorphicSDK/tools/adminConsole.jsp.
To manually edit your configuration, open isomorphicSDK\WEB-INF\classes\server.properties in a text editor. This file contains configuration blocks for HSQLDB, MySQL, Oracle, PostgreSQL, and DB2. The sql.defaultDatabase variable controls which block is actually used by the system. To use a database other than the embedded HSQLDB, comment out the line that reads sql.defaultDatabase: HSQLDBand uncomment the line that reads sql.defaultDatabase: <your database type>.
After you have selected the database type, ensure that other configuration parameters in this file are set appropriately for your system. For a custom installation, you may need to change the values of the following variables:
|sql.<DBtype>.driver.serverName||Name or IP address of the system on which the database is running|
|sql.<DBtype>.driver.portNumber||TCP port on which the database is listening for connections|
|sql.<DBtype>.driver.databaseName||Name of the database as known by the database server|
|sql.<DBtype>.driver.user||Database username for SmartClient requests. Ensure that this user has the following privileges: create/alter/drop tables; create/drop sequences (Oracle); insert/update/replace/delete rows.|
|sql.<DBtype>.driver.password||Password for the given database username.|
Refer to the comments in server.properties for more information.
Note: You must restart your servlet engine whenever changes have been made to server.properties.
4. Import SDK sample data
To import the sample data:
- Open the SmartClient Admin Console.
- Click Import DataSources in the options tree at top left.
- Click/shift-click or right-click to select all datasources in the list at top right.
- Click on the Import button.
Importing all sample data may take more than 10 seconds. A dialog will appear when the import operation has completed.
If you get an out of memory error when importing a very large data set (e.g. the productRevenue sample data), you will need to increase the maximum heap size of your JVM (e.g. java.exe -Xmx128M).