database selection at startup

my client needs the ability to connect to one of two (identical)
databases when the servoy application starts up.

in one case, the user is in the home office, on his/her
laptop, connected via lan to the company server. the
solution file will be stored on the laptop, along with a
copy of servoy.

in the second case, the user is out of the office (using the same laptop),
and will run the same servoy solution, but needs to
connect with an exact replicla of the company database
that is stored on the laptop.

how can i have servoy connect to one server or the other,
under program control, at startup time, without the user
having to go into Preferences/DB Servers and changing
the Database Server URL manually?

it would be ok with the client to put up a dialog at startup,
asking the user if this is a “remote” or “local” connection,
but i can’t figure out how to switch between databases,
since they seem to be “hardwired” from the design area.

this is very important to the client; without this capability,
the project will probably not continue.

help (please!)
rm.

…as an alternative to what i’m trying to do in my last post,
i could possibly export records from one database, and
import them into the other (remote or “offline”) database.

the tricky part with this method is, i can’t find any way to
import & export records under program control; only by
using the import & export menu items under the file menu.
this is unacceptable, as we don’t want our users to be
responsible for importing & exporting records.

so the next question is: can i export & import records
under control of a script?

first of all.
clients don’t have database connections.. The server does.
So what do you mean with:

without the user having to go into Preferences/DB Servers and changing
the Database Server URL manually

because a client can’t go to that specific preference tab… (it doesn’t have that tab)

The solution you could do now if you can synchronize the database yourself at this moment. That the laptop connects to the office server when he is at the office, (starts a client from the office server)
And if he is at home, he starts a client that connects to itself. But then you need to install a server on the laptop itself.. And that one does connect to the database on the laptop..

We do have a real offline client on the planning and also scripting import/export is on the planning right after 2.0.

jcompagner:
That the laptop connects to the office server when he is at the office, (starts a client from the office server)
And if he is at home, he starts a client that connects to itself. But then you need to install a server on the laptop itself.. And that one does connect to the database on the laptop..

ah! perhaps that’s the answer…hmmm.
i’ll have to think this through.

We do have a real offline client on the planning and also scripting import/export is on the planning right after 2.0.

excellent! when will 2.0 be released?

also, i could solve my problem if i could create text files
on the user’s hard drive and just write out the information
i need…but i can’t find a way to create a file and write (or
read) from it. can this be done?

Yes, this can be done. You have application.readTXTFile, readFile, writeFile and writeTXTFile for this.

Veeeeeeeeeeeeeery powerfull…

you can use this in combination with, for example, createTempFile and the file plugin to set and get all kinds of attributes, folders etc…

IT2BE:
Yes, this can be done. You have application.readTXTFile, readFile, writeFile and writeTXTFile for this.

marcel, thank you very much for your reply. this is what
i need to do to make everything work for my client.

on another note, i’m somewhat disappointed by the lack
of response from the servoy developers; it’s been two
days since i posted that question. as a registered user
of servoy, i expect (and need) to get responses more
rapidly.

this has happend several times in the past as well.

we’re still not sure if servoy has the capabilities to do
what we need it to do, and if it does not, we’ll need
to choose another product (or code the whole thing
in a regular programming language).

is there another avenue for registered user to get
support issuses resolved quickly?

rm.

Robert, I understand your disappointment but I can’t say anything but ‘Servoy gives great support’.

We have to respect the fact, imho, that Servoy developers should do what they are best in. Develop Servoy further into the sky…

I can imagine that with the increasing number of experienced users responce times will go up.

As for your question concerning ‘is Servoy the right tool for the job’. Just ask… I (and am sure others with me) will try to help you to make your decision. As always some things will be suitable and some will not.

If you want/need faster responce I think there is a clause in the SAN memebership giving you priority support on certain issues.

A training is an option too (you could get a training from me if you want)…

RobertMeyer:
on another note, i’m somewhat disappointed by the lack
of response from the servoy developers; it’s been two
days since i posted that question. as a registered user
of servoy, i expect (and need) to get responses more
rapidly.

Our average response time to questions is well below 4 hours. And that for unpaid forum support. If you have purchased support (part of the subscription license), you can also contact support@servoy.com for faster response.

jaleman:

RobertMeyer:
on another note, i’m somewhat disappointed by the lack
of response from the servoy developers; it’s been two
days since i posted that question. as a registered user
of servoy, i expect (and need) to get responses more
rapidly.

Our average response time to questions is well below 4 hours. And that for unpaid forum support. If you have purchased support (part of the subscription license), you can also contact support@servoy.com for faster response.

i was not aware of that. we have purchased servoy, and i’ll
use that mechanism from now on. thank you.

At this moment having two servoy.properties files (one pointing to your local server one to office server) would be the easiest (rename the file, you could script that). Our offline edition scheduled for this summer will make working in multiple locations automatic.

that sounds like a great way to solve the problem.

thanks.