Results 1 to 12 of 12
Thread: best way to handle db connection
- 02-15-2011, 11:25 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
best way to handle db connection
Hi, i'm going to create a client app using java, i need to know whether there is a better method (framework) to handle the database.
i'm using ejb when i'm working with j2ee app, but i don't know if there is a better ( efficient ) method for client applications to work with db. Please advice.
Thanks
- 02-15-2011, 02:14 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
What do you mean by a client app?
- 02-15-2011, 02:52 PM #3
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
The advantage of creating a 3(+)-tier, EJB based server side application is that the client doesn't need to directly 'work with db'. When that logic is server side, clients don't get crudded up with code that makes it harder to maintain in the long run.
- 02-15-2011, 04:20 PM #4
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
Just a desktop application, not a web application, so i'm not going to run any application servers(tomcat, jboss). Therefore i won't be able to use ejb. I think im correct, am I ?
- 02-15-2011, 05:04 PM #5
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
You tell us. You mentioned you use(d) an ejb J2EE application, if this is already developed for the same data source then why re-invent the wheel in the client. But as Tolls alluded to, you haven't provided much information to give specifics.Therefore i won't be able to use ejb. I think im correct, am I ?
- 02-15-2011, 05:33 PM #6
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
No, this is a totally different system.
- 02-16-2011, 06:27 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Design decisions cannot be made based on such a small amount of info.
Is the database going to be shared between instances of this app?
If not, then is the database going to be fairly small?
If it is shared then is it shared with any other apps?
You have to provide us with informationon which the base our advice.
- 02-17-2011, 04:56 AM #8
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
Yes, database is going to be shared between instances of this app.
No, it will not be shared with any other applications.
only this application will communicate with the db.
- 02-17-2011, 06:12 AM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
So there is already a server involved.
The one with the db on it.
I would stick some server code in front of that that handles db interactions personally. Have your app interact with that.
- 02-17-2011, 06:38 AM #10
Member
- Join Date
- Feb 2011
- Posts
- 5
- Rep Power
- 0
you must add JDBC driver to your project to connect to db directly without any additional layer .
- 02-18-2011, 04:01 AM #11
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
sorry Tolls, i didn't get u.
What's the server involved with db ?
- 02-18-2011, 06:00 AM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
You said:
That means multiple instances of your app will be talking to the same db.
That implies (since you haven't explained anything else about your app) that the db is central and that implies it's on a server.
You have to realise we do not know your system so are reduced to guesswork when you don't provide us with enough information.
Similar Threads
-
how to handle data over two distinct socket connection
By krishforever in forum New To JavaReplies: 7Last Post: 02-03-2011, 10:57 AM -
Java.net.socket connection :connection closed
By veeru541 in forum Advanced JavaReplies: 2Last Post: 06-27-2010, 02:14 AM -
How to handle ArrayIndexOutOfBoundsException
By 3xpr1ment in forum New To JavaReplies: 6Last Post: 03-03-2010, 03:16 PM -
Handle sound
By varsamakos in forum AWT / SwingReplies: 4Last Post: 12-26-2009, 09:40 PM -
how to handle files?
By sayan751 in forum Advanced JavaReplies: 5Last Post: 06-10-2009, 08:39 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks