A data source maintains a pool of connections to a database server, increasing performance by allowing connection sharing and reuse.
In the Management Console, expand the Resources folder and locate the JDBC Data Sources folder beneath it. Right-click on JDBC Data Sources folder and choose Add.
In the New Data Source wizard, enter Glossary as the name. Finish the wizard to display the properties for the new Glossary data source.
Configure the properties on the General tab listed in Table 6-3, then click Apply to save the changes. Leave properties that are not listed in Table 6-3 at their default setting.
Be sure to click Apply to save changes when switching
between tabs in property pages.
The Database Type setting determines the default settings
for other data source properties. In this case, setting it to Sybase_ASA
(to
indicate Sybase Adaptive Server Anywhere) causes EAServer to use
Sybase jConnect as the database driver as well as making the default
URL format the one used by jConnect. You can define and modify database
types to change the default data source property values for that
database type.
Setting |
Value |
---|---|
Database Type |
|
Server name |
localhost |
Port Number |
|
User name |
|
Password |
|
Configure the Database tab settings listed in Table 6-4 and click Apply. These settings allow EAServer to start and stop the server automatically. Leave settings that are not listed at their default value.
Setting |
Value |
---|---|
Database File |
~/data/gloss.db |
Database Create Command |
Leave blank. This setting can be configured to create a database file for EJB CMP entity beans. We have already created the database file. |
Database Start Command |
This command runs asa-start (located in
the EAServer bin directory), starting the server
to listen on port 2640, with engine name matching the data source
name ( |
Database Stop Command |
This command runs asa-stop (located in the EAServer bin directory), stopping the server. The command specifies the user name and password required to connect and the engine name. |
Database Command Echo |
Enabled. |
Database Command Destroy on Exit |
Disabled. |
Verify the data source properties as follows:
Expand the Data Sources folder.
Right-click the Glossary data source and choose Ping.
Since the server is starting the database, it will take some time before Ping completes. If the Ping operation fails, confirm that you have applied the settings correctly and that the database is running. You can see the database commands on the server console and in the server log file.