Samples

fileGrep - Jaxer Filesystem Access Sample

This sample application demonstrates some of the filesystem access capabilities of the Jaxer Javascript framework.

You can download a zip of the sample here.

Running Jaxer with MySQL

Changing the Database Configuration Settings

To run Jaxer with the mysql database it is just a matter of making a very simple change, to a single file
<INSTALL FOLDER>/local_jaxer/config.js

As shipped this file contains a set of common configuration overrides, but they are all commented out. The file is a simple JS function that updates a set of property values on the Config object. The source for this file is shown below

uncomment lines 33-43 if you only want to use MYSQL for your application data

uncomment lines 44-54 if you only want to use MYSQL for the jaxer server metadata

uncomment lines 33-54 if you want to use MYSQL for both application data and server metadata

Once you have uncommented the lines you need to provide the connection parameters for your MYSQL instance.

The Config.DB_CONNECTION_PARAMS / Config.DB_FRAMEWORK_CONNECTION_PARAMS objects have properties for

HOST : the ip address or uri for the server
PORT : the port the server is running on (typically 3306 for MYSQL)
NAME : the name of the database to use
USER : user name
PASS : password

Set these value to match your database. Then restart Jaxer to load the changes, your Jaxer instance will now be running with MYSQL

After the changes the config file will look something like this.

Creating a Connection to a MySQL db.

For many applications you wont want to use the built-in jaxer DB instance definitions and will require a dedicated connection to another instance or perhaps a separate database on the same instance.

The code below is an example of how to create and use a connection to a database.

Syndicate content