Note: there are scripts in [tomcat]/webapps/asset-bank/WEB-INF/manager-config/database to run the steps below: database-setup.cmd (Windows) and database-setup.sh (Linux).
Create a new database. By default call it assetbank.
Create a database user. By default call this application.
Give the user ALL privileges on the database.
Connect as root, and run the install-mysql.sql script from the installation database folder (it is also in [tomcat]/webapps/asset-bank/WEB-INF/manager-config/database).
Download MySQL Connector for Java v5.1.36 either as a tar.gz or as a zip.
Extract the archive.
Copy mysql-connector-java-x.x.x-bin.jarfrom the extracted folder into [Tomcat]\lib directory
2. SQL Server Database setup (SQLServer 2005 to 2016)
Create a new database login, with SQL Server Authentication. By default call this application. The following should all be UNchecked: Enforce password policy, Enforce password expiration, User must change password at next login.
Create a new database, with Name=assetbank, and Owner=application. The application user should be owner since the Asset Bank updater function will run under this user to create and update tables. The database needs to use a case insensitive collation. It requires either the db_owner permission , or at least "db_datareader, db_datawriter, db_ddladmin and public".
Now connect to SQL Server using the application login, and run the install-sqlserver.sql script from the installation database folder.
Note for SQL Server 2005, the following configuration steps should be done in SQL Server Configuration Manager to allow JDBC access:
SQL Server 2005 Services: Enable and start Sql Server Browser
Protocols: Enable TCP/IP protocol
Copy mssql-jdbc-6.2.2.jre8.jar into [Tomcat]\lib directory Please note: if you want to use the driver for an existing installation you might also need to update the connection string in database-local.properties. An example can be found in database.properties.
Please ensure that tempdb is configured appropriately for row version storage by following the recommendations in http://msdn.microsoft.com/library/ms345124.aspx. Specifically, we recommend that the initial size of tempdb is at least 50MB and that it's located on a fast disk.
Copy [Tomcat]\webapps\asset-bank\WEB-INF\classes\database.properties to [Tomcat]\webapps\asset-bank\WEB-INF\classes\database-local.properties
Open [Tomcat]\webapps\asset-bank\WEB-INF\classes\database-local.properties in a text editor and ensure that the example settings for the database type you are using are uncommented and the example settings for the other databases are commented out (or deleted). Comments are lines beginning with '#'. By default the MySQL settings are active and the SQL Server settings are commented out.
Update the following properties if necessary for access to your database: database.url, database.username and database.password.
In the file [Tomcat]\webapps\asset-bank\WEB-INF\classes\ApplicationSettings.properties search for the property sql-generator-class and update its property to suit the database you installed (potential values for this property are detailed in a comment above the property itself).
5. Database connection settings - older versions of Asset Bank - components.xconf
Note: You should only attempt this step if you are familiar with editing XML, as incorrect commenting/uncommenting can cause the system to stop working.
In the file [Tomcat]\webapps\asset-bank\WEB-INF\components.xconf, database configuration is towards the top of the file. Locate the <component> element relevant to the database you are using and ensure it is uncommented. Make sure that the other component elements are either commented out or removed from the file completely. For example if you are using MySQL the component preceded by the comment <!-- MySQL Data Source --> should be uncommented.
Inside the <component> element, update the following elements if necessary for access to your database: <dburl>, <user> and <password>.
In the file [Tomcat]\webapps\asset-bank\WEB-INF\classes\ApplicationSettings.propertiessearch for the property sql-generator-class and update its property to suit the database you installed (potential values for this property are detailed in a comment above the property itself).