database selection at startup

Questions and answers regarding general SQL and backend databases

database selection at startup

Postby RobertMeyer » Fri Mar 12, 2004 10:06 pm

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.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

or...

Postby RobertMeyer » Sun Mar 14, 2004 8:51 pm

...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?
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby jcompagner » Sun Mar 14, 2004 10:27 pm

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.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby RobertMeyer » Tue Mar 16, 2004 1:40 am

jcompagner wrote: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?
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Tue Mar 16, 2004 2:58 pm

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...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby RobertMeyer » Wed Mar 17, 2004 6:23 pm

IT2BE wrote: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.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Wed Mar 17, 2004 7:15 pm

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)...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Jan Aleman » Wed Mar 17, 2004 10:57 pm

RobertMeyer wrote: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.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby RobertMeyer » Thu Mar 18, 2004 12:00 am

jaleman wrote:
RobertMeyer wrote: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.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby Jan Aleman » Thu Mar 18, 2004 12:35 am

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.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby RobertMeyer » Thu Mar 18, 2004 5:09 pm

that sounds like a great way to solve the problem.

thanks.
RobertMeyer
 
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 26 guests

cron