Difference between revisions of "Database Tutorial"
From RifidiWiki
(→Prerequisites) |
|||
Line 43: | Line 43: | ||
To get started | To get started | ||
− | * Follow the directions here: [[ | + | * Follow the directions here: [[Edge Server Development Environment]]. |
* Create a new application project following similar directions to the northwind project: [[Northwind Creating the Application]] | * Create a new application project following similar directions to the northwind project: [[Northwind Creating the Application]] | ||
* For more instructions about how to use emulator with your application see [[Northwind Using Emulator]] | * For more instructions about how to use emulator with your application see [[Northwind Using Emulator]] |
Revision as of 23:30, 30 November 2009
This document provides instructions for creating an edge server application that logs RFID tags to a database.
Contents
Download and Run the Application
This section provides instructions on how to download the final application and run it. It assumes you already have downloaded and installed the edge server and that you know how to read tags. If you need help with this see Edge Server Getting Started
MySQL Configuration
If you are using MySQL
- First set up a MySQL instance and create a database called rifididb. There are no instructions here on how to set up MySQL on your system. There are plenty of tutorials on that, however.
- Now open up 'edge server.ini' in the edge server file and add this:
-Dorg.rifidi.jdbc.driver=com.mysql.jdbc.Driver -Dorg.rifidi.jdbc.url=jdbc:mysql://127.0.0.1/rifididb -Dorg.rifidi.jdbc.user=root -Dorg.rifidi.jdbc.pass=root
Derby Configuration
If you are using Derby
- You don't need to configure a derby DB in the same way you have to configure a MySQL DB, since it is embedded.
- Open up 'edge server.ini' in the edge server file and add this:
-Dorg.rifidi.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver -Dorg.rifidi.jdbc.url=jdbc:derby:RifidiDB;create=true -Dorg.rifidi.jdbc.user -Dorg.rifidi.jdbc.pass
Run the App
Note that you need to set the url, user, and pass to the values according to your database.
- Start up the edge server, workbench, and start reading tags just like you are used to doing.
- Now type this into the edge server console (at the osgi prompt)
loadApp dbapp
That is what loads the application.
- Wait for it to tell you the bundles are loaded properly. Then type this:
dbstart
Prerequisites
This tutorial assumes that you are using eclipse, that you have some java development experience, and that you know how to run the edge server and get tags back from it. The Northwind Tutorial is much more in-depth than this one, and is recommended for people who have little experience with java and/or eclipse.
To get started
- Follow the directions here: Edge Server Development Environment.
- Create a new application project following similar directions to the northwind project: Northwind Creating the Application
- For more instructions about how to use emulator with your application see Northwind Using Emulator