In this section we will describe how to install a database for JBoss Nukes portal, this suppose that you already installed JBoss.
Instructions are written for Debian Linux but except for package installation the process should be the same for any operating system.
The following instructions assume you are a new user installing Nukes for the
first time and are compiling from source (either checked out via cvs or
obtained from a snapshot).
Pick any database below for installation, by default MySQL is used.
-
HSQLDB
Homepage: http://hsqldb.sourceforge.net
Driver: already installed by default (hsqldb.jar)
It is not recommended that it be used when running Nukes on a production site.
However. itis a great db to use if you just want to check out Nukes, or are
doing development work.
In order to use HSQLDB, perform the following steps:
edit the local.properties file in the 'build' directory and set the following property
nukes.database = hsqldb
execute the following command inside the 'build' directory. This will compile Nukes for HSQLDB.
build
start jboss
copy the setup.bsh file contained in $NUKES_SRC_DIR/nukes/output/resources/hsqldb to $JBOSS_HOME/server/<nukes.deploy.dir>.
Unless you are using NukesAdvancedSetup 'techniques', replace <nukes.deploy.dir> with 'default'
This will create the tables required for the core. There is no need to setup a user/password; the 'sa' user is used by default.
check the JBoss console output to make sure no errors occurred and that the script has completed. You will see the message '... DONE!' when it has completed.
remove the setup.bsh file from the deploy directory. failure to do this will cause JBoss to drop and re-create the tables upon every shutdown/startup.
If you wish to access the HSQLDB database from outside of JBoss using an external client (see NukesUsingHSQLDB for information on obtaining a client), you will need to edit the following:
$JBOSS_HOME/server/<nukes.deploy.dir>/deploy/nukes-ds.xml
Follow the instructions inside the datasource on how to enable remote access.
-
MySQL
Note: MySQL is the default value for the nukes.database property.
In order to use MySQL, perform the following steps:
First of all, if MySQL is not installed on your machine, looged as root type:
root@laptop:~$ apt-get install mysql-server
root@laptop:~$ apt-get install mysql-client
On other distribution or operating system:
Download your binaries from http://dev.mysql.com/downloads/mysql/4.0.html and unpack them
By default on Debian, networking access is forbidden you have to edit the file /etc/mysql/my.cnf and comment out (add a at the beginning of the line) 'skip-networking'.
Restart the database to listen on port:3306
root@laptop:~$ /etc/init.d/mysql restart
You should as well change the root password by typing:
theute@laptop:~$ mysqladmin -u root password 'myN3wPassw0rd'
Now you can log on MySQL by typing:
theute@laptop:~$ mysql -u root -p
Create nukes database: (you can change the name if you want)
In the MySQL console type:
mysql> CREATE DATABASE nukes;
The output should be:
Query OK, 1 row affected (0.01 sec)
Add a user (pick any name if you don't like 'nukes' as database username:
mysql> GRANT ALL PRIVILEGES ON nukes. TO 'nukes'@'localhost' IDENTIFIED BY 'nuk3sPassw0rd' WITH GRANT OPTION;
The output should be:
Query OK, 0 rows affected (0.00 sec)
One last thing that is database specific is to get the Java connector:
Get the MySQL connector from mysql.com and copy the .jar into $JBOSS_HOME/server/default/deploy
Go to http://dev.mysql.com/downloads/connector/j/3.0.html and save the file to /tmp
theute@laptop:~$ cd /tmp
theute@laptop:/tmp$ tar zxvf mysql-connector-java-3.0.14-production.tar.gz
theute@laptop:/tmp$ cp mysql-connector-java-3.0.14-production/mysql-connector-java-3.0.14-production-bin.jar $JBOSS_HOME/server/default/deploy
That's it your database is ready to go, you can go ahead with the installation process by using the installer.
Homepage: http://www.mysql.org
Driver: http://dev.mysql.com/downloads/connector/j/3.0.html
-
Others
If you wish to use one of the remaining databases listed, a setup.ddl will
be generated for you, however you are on your own to provide a prepare.ddl,
which would include the following steps:
create nukes database
create nukes user
assign correct privledges
PostgreSQL
Homepage: http://www.postgresql.org
Driver: http://jdbc.postgresql.org
nukes.database property value: postgres
Oracle
Homepage: http://www.oracle.com
Driver: http://otn.oracle.com/software/tech/java/sqlj_jdbc/index.html
nukes.database property value: oracle8
In order to use one of these databases, perform the following steps:
edit the local.properties file in the 'build' directory and set the following property (see above for correct value)
nukes.database
execute the following command inside the 'build' directory. This will compile Nukes for your chosen database.
build
Once the build has completed, two ddls will have been created inside the following directory $NUKES_SRC_DIR/nukes/output/resources/<database>
setup.ddl
Using your databse client of choice, log in as the root user and execute your self created prepare.ddl, followed by the setup.ddl to create the core tables.
-
If you are interested in the details of why the core has not been converted to
a pure CMP implementation, see the following thread in the forums:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=50742
The previous instructions found on this page have been relocated here: NukesDBSetup1.0
Comments