If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Simple DB Connection Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-25-10, 14:25
aztroboy aztroboy is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
Simple DB Connection Question

Greetings everyone,

I'm not an expert on DataBase programming/design/engineering/etc, so I've got a simple question regarding the correct way one should connect to a DataBase.

I'm posting on the Java Sub-Forum because I'm using Java. I'm working on a Client UI that must check every two seconds for updates on a DB. The Client and the DB are located in different places and connected through a VPN (server hosting place - home).

There are two methods that I've considered for connecting to the Server:
(1) By executing queries directly from [client] -> [database]
(2) By hosting a simple PHP service that executes queries locally: [client] -> [php -> database].

Now, if the two PCs (client and DB) are connected within the same LAN, the updating delay for each solution is basically the same. BUT If I ran the same two solutions from home (via the VPN) I noticed that (1) takes about 14 seconds to complete, whereas (2) is very fast.

So, a question to the people that know about DB programming/managing: In terms of design, which of (1) and (2) should be implemented and is correct?

thank you
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On