Almost all Servoy applications utilize a database to store user data and application metadata. Servoy can connect to any database that has a JDBC driver available. Servoy provides a database, Sybase SQL Anywhere, for you if you do not already have a database management system (DBMS).
Creating a New Database in Sybase SQL Anywhere
In Servoy Developer, you may create a new SQL Anywhere database from the Solution Explorer tree.
- In the Servoy Developer Solution Explorer tab, expand the Database Servers node (under Resources) and right click on a SQL Anywhere database (all the example databases provided by Servoy are SQL Anywhere) to show the popup menu.
- Select Create Sybase Database.
- Enter a name for the database in the dialog window.
- A dialog will appear indicating a Sybase database restart is required.
- A dialog will recommend to restart Servoy Developer. Click OK. and close Servoy Developer.
- Close Sybase SQLAnywhere.
- On Windows - Look for the orange lighting bolt in the system tray, right click, and select Shut down "servoy_repository"
- On Mac and Linux - find the dbsrv11 process and shut it down.
- Restart Servoy Developer.
- Your database will appear in the Database Servers node.
Connecting to an Existing Database
You may also connect to an existing database in Servoy Developer.
- Determine the JDBC driver required for making connections to your database. You can find the proper driver normally from the DBMS manufacturer/documentation; another source that may help is the Servoy Forum as other developers have possibly used your database with Servoy.
- Install the driver by placing the .jar file in the application_server/drivers folder in your Servoy installation folder.
- Restart Servoy Developer.
- Create a new Database Server connection by right clicking on Database Servers node (under Resources) and selecting New Server. A submenu will provide choices of different popular database choices that will fill in some of the connection information to make setup easier, or you may choose empty.
-
It is best practice to create your data model (tables, primary keys, foreign keys, and fields)