Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 7th, 2006, 8:58 AM   #1
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
Client-Server application

I have this idea in my head of a software program in vc++.net that connects to an SQL database and processes certain transaction.
I would like to ask you guys if my approach towards the following "idea" is the way is it done in the real world or is there alternative ways about it..
So there are several computers connected in a network one of which is a server which contains a database with information inside. all the rest are simple applications that would request information from the server in order to process them (buy.. sell.. whatever).
My idea is that, when each client program whats to read/write data to the database located at in the server, Clients and server would have agreed upon codes for each transaction. so the client send 200-John .. which could mean find the adress of all people in the database with name john.
this would be done say using Winsock library, and the server would ofcourse set-up its socket and can listen to many incoming connections at once. once the server recieves 200-john. the server connects to its database and finds the result and sends it back to the appropriate client say 500-airport_road..
is this how it is done in real life.. or is there some method where each client can directly hook up to the SQL database without this "server" that comes in-between the client and the database.
Thanks Y'all
hbe02 is offline   Reply With Quote
Old Jul 7th, 2006, 9:18 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
This is a valid approach. However, if all you are wanting to do is to query the database.... you could establish a database connection from within the "client" side, nest your sql command along side it and parse the results from the executed command. This way there would be no need to send special encoded key-value transactions to and from the server. That method would only be beneficial if you were doing other things in addition to querying the DB, like writing files to the server, pulling updates, etc.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 7th, 2006, 9:24 AM   #3
melbolt
Professional Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 254
Rep Power: 4 melbolt is on a distinguished road
If it were me...

I'd say lose the winsock and get web services kicking since you're in .NET anyways

also i'd form a data layer which simply calls a stored procedure or makes a query to your database, stores the results in an object and returns that object through webservices to your client side.
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote
Old Jul 7th, 2006, 1:24 PM   #4
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
Thanks for the feedback guys..
IR.. I belive your suggestion would best suit my purpose, as this project would be the first of its kind and somewhat "the next level" for me... ill start with a simple SQL commands based application, so it would be easier to nest the SQL commands in the data im sending.
As for Melbot's reply, sounds like an interesting perspective.. Im still in the process of learning about the .NEt framework and will reach web services in a few chapters and i will definitely look into how your alternative works..
Thanks again.
hbe02 is offline   Reply With Quote
Old Jul 7th, 2006, 4:52 PM   #5
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Webservices, such as SOAP is probably an excellent idea here in my opinion. Problem with having a client connect directly though is permissions, this can be a bit more insecure than using a Client/Service approach, additionally that you need to aquire licenses to connect to the database (or publish client code to use mySQL) while if you don't release the server publically, you don't have to publish the code for it.

Using a client connection to the database tends to have many drawbacks, espcially for what it seems he is trying to do.
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:19 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC