Re: Multiple RowSets redux...



On Jan 30, 2:41 am, Dyreatn...@xxxxxxx wrote:
mdR <mr...@xxxxxxxxxxx> writes:
ok, i think i'm getting a handle on the whole MVC thing and how i
should be constructing my db application. But i am still confused on
one thing. (well probably more, but one for now)

again, i am trying to build an app that displays data from multiple
tables in a single Derby database. the tables will be displayed in
two different JTables with two different TableModels displayed on the
same frame. Each TableModels will get their data from a JDBCRowSet
object. My question is, should each TableModel have it's own
JDBCRowSet instance; which seems the most straight-forward, but
requires multiple connections--or is there a better way-- to somehow
use one connection and retrieve multiple result sets?

No, connections are not _that_ expensive. In Derby
the connection is simply a Java thread with an associated socket. It
doesn't grab huge chunks of memory so it does not add much to the
footprint either.

Note that in Derby obtaining the first connection (with the create=true
property) could take some time, because the whole database gets
created. But getting the next connection to that database will be very
quick (as will getting a connection to an existing database).

And you should use PreparedStatements for anything where performance is
important. This is true for most databases, but especially for Derby
which compiles SQL to java byte code which is a rather heavy
process.



btw--this is going to be a multi-user client/server app.

--
dt

Questions about Derby/Java DB? Please visithttp://db.apache.org/derby/derby_mail.html

Great! Above combined with Lews comments puts me on the right
track.
And yes, I plan on using PreparedStatements.
Thanks again.

-mark
.



Relevant Pages

  • Re: Multiple RowSets redux...
    ... tables in a single Derby database. ... Each TableModels will get their data from a JDBCRowSet ... the connection is simply a Java thread with an associated socket. ...
    (comp.lang.java.databases)
  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: Communicating over the internet
    ... > That way you provide one manner in which to open the database, ... > can keep the connection open and then when someone wants to ... > server as the database and the soap dll connecting with a TCP socket. ... The name of the running program might help. ...
    (microsoft.public.vb.general.discussion)