Steps in creating derby database

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

Steps in creating derby database

#1

Postby alvinsanusi » Thu Jan 05, 2017 1:39 pm

I am sorry for raising a simple question. I have installed eBase version 5.2.0 community version and want to create a new database called DBASE_CLIENT.
Searching around I just know that I need to create a dbase_client.sql text file and then create a connection in Server Admin App.

But I think there is something missing. Can anyone lead me to the proper document about it or provide me with a complete steps in creating the database?

Thanks beforehand for all information.
0 x
It is what all eyes see and all fingers point to

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Thu Jan 05, 2017 3:41 pm

Hi,

The easiest way to do this is to create a new database connection in the server admin app and add create=true to the JDBC URL.

Open the server admin app and click on databases.

Add a new database and enter the information:

Image

This example creates a Derby Database called DBASE_CLIENT and it will be saved physically to: c:/mydatabase/DBASE_CLIENT

By clicking the "Test Database Connection" button... creates the database because of the create=true parameter on the URL.

Once created you can change/remove the create=true, but this is not essential.

Note that this only works for Apache Derby databases. And this example assumes that you are using a Derby Embedded JDBC connection. You can do the same using Derby Network Connection by adding the URL and adding the create=true onto the URL parameters.

Once created, you can create tables in the database using the Database resources "create database table".


Kind regards

Steve
0 x

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

#3

Postby alvinsanusi » Fri Jan 06, 2017 6:17 am

Hi Steve,

Thanks for the information.
I have successfully created the database in the server. However,
I still don't know how the tables are created. Is it using the command line of Derby?

Also, I want to create the database in the integrated environment. How to do that?
0 x
It is what all eyes see and all fingers point to

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Jan 06, 2017 9:52 am

It is possible to create tables using the Create Database Table icon at the top of the Database Resource editor, but not many people work this way. Most people use a SQL tool of some sort - there are many available - I use Squirrel most of the time.

The Ebase Xi designer is distributed with an embedded Derby database - embedded means that it can only be accessed by one application at a time, which is usually the Ebase Xi integrated server; this means that you can't attach a SQL tool to it at the same time as the integrated server. To get around this, you can stop the integrated server, then attach your SQL tool to create tables etc, then restart the integrated server.

This is quite a lot of trouble to go to and maybe it's acceptable if you just want to create a few tables, but probably not for serious development. Therefore most people use external databases, work with these using the database's own tools or a general purpose tool like Squirrel, then just create a database connection in Ebase Xi to connect to the database. You can use pretty much any database you fancy - Oracle (there's a free version), Postgres, MS Sql Server, MySql, Apache Derby (running in network mode).
0 x

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

#5

Postby alvinsanusi » Fri Jan 06, 2017 11:19 am

Thanks Jon for the information.
I will try to figure out how to handle it.
Can I check with you that the file in ufsServer/tomcat/conf/Catalina/localhost/ebase.xml is having an equivalent file in ufsClient/IntegratedServer/ebasetest.xml?

I have actually installed squirrel. But so far has no success in accessing the database.
0 x
It is what all eyes see and all fingers point to

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

#6

Postby alvinsanusi » Fri Jan 06, 2017 1:25 pm

Dear Everyone,

Thank you for all the help and information provided.

I finally figured out how to work with ufsServer as well as ufsClient. I have created database connection in both server. (By the way, I installed both in 1 notebook). I have also created tables in ufsServer using Squirrel.

However, I still can not figure out how to connect to ufsClient using Squirrel. If you know of the way, please just drop me the information. Otherwise, I will try other method to create the tables.

Again, thank you for all the help and information.

Best Regards,

Alvin
0 x
It is what all eyes see and all fingers point to

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#7

Postby Jon » Fri Jan 06, 2017 2:51 pm

Both servers are the pretty much the same. The standalone server (UfsServer) uses ebase.xml, and its integrated server equivalent (in UfsClient) uses ebasetest.xml. To use squirrel you just need a JDBC URL to define the connection - this should be the same in both cases except that the path to the database will be slightly different.

You can add a database connection via ebase.xml/ebasetest.xml - this is known as a pooled connection in application server, but these are mostly supported for legacy reasons. It's more usual to add a pooled connection - these have the advantage that you don't need to restart anything to create the connection and they are simpler to create (doesn't involve editing xml files). Both types are added using the server admin app - which you've probably already figured out.

There's more information on JDBC Urls here - http://www.ebasetech.com/ebase/doc/URL_ ... trings.htm
0 x

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

#8

Postby alvinsanusi » Tue Jan 10, 2017 5:13 am

Thanks Jon for the information.

Appreciate your help very much.
0 x
It is what all eyes see and all fingers point to


Who is online

Users browsing this forum: No registered users and 63 guests