Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #642

Re: Local database library

From Kevin Nathan <knathan@project54.com>
Newsgroups comp.lang.java.databases
Subject Re: Local database library
Date 2013-10-26 12:08 -0700
Message-ID <20131026120811.1a9bc341@efreet.linux> (permalink)
References (1 earlier) <nospam-29AECA.15371802102013@news.aioe.org> <20131004110242.1be4f5ea@efreet.linux> <d50f8d5a-bf95-4d95-bc93-6a53b0a16522@googlegroups.com> <20131005120659.39a89f3b@efreet.linux> <ec4d1b88-d33a-4b76-a0e6-709319845718@googlegroups.com>

Show all headers | View raw


On Tue, 15 Oct 2013 16:41:16 -0700 (PDT)
Lew <lewbloch@gmail.com> wrote:

>> and even more complex queries into JPA, I will start that process.  
>
>That would be insane and stupid.
>
>You don't convert queries into JPA; that's utterly backwards. If you
>have a data orientation, you use straight-up JDBC, not JPA.
>
>JPA is for creating persistent *objects*.
>

I have mentioned in this thread that I am *very* new to Java. But I've
been programming since 1979 (very little formal training). I mentioned
JPA because you said that was by far the easiest to code and maintain.
I know nothing about it.


>> Until that happens, I will have to muddle through with the brute
>> force methods that a previous programmer used...  
>
>It is weird to hear SQL described as "brute force".
>

It's not SQL that is the brute force method, it's putting the SQL into
every Java file that needs it, often the same query, or very similar,
query. It works, but not what I would like to see. The data access is
not split out from the rest of the code, and that was what I was
wanting to do. 


>Your queries, if they are reasonably standard SQL, go directly into
>JDBC 'Statement' objects. (Use 'PreparedStatement'.)
>

That's what we use. But the previous programmers simply stuck them in
every class (copy/paste), as needed, so the SQL is scattered throughout
the code. In the C++ code we have a locally written DAO library of
various classes like Transaction, Seller, Buyer, etc., and if you need
a list of Transactions by Seller, you simply include those classes and
call methods. So, I was hoping to make a simple mirror of our C++ DAO
library. I can't make it work. I don't know what I am missing (very new
to Java, remember). 

And I obviously cannot explain my problem well enough, so I will not
bother you with this anymore. Maybe, if I knew Java better, I could
formulate a better question or series of questions. For now, I will
just continue putting the raw SQL into every class and later, when I
know what I am doing in Java, I will clean it up.

Thanks for all of your efforts to help!

-- 
Kevin Nathan (Arizona, USA)  
Linux is not a destination, it's a journey -- enjoy the trip!

Linux 3.7.10-1.16-desktop
 11:50am  up 37 days 22:03,  15 users,  load average: 0.62, 0.63, 0.56

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Local database library Kevin Nathan <knathan@project54.com> - 2013-10-01 13:52 -0700
  Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-01 17:38 -0400
    Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-01 15:41 -0700
      Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-01 20:53 -0400
        Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-02 10:09 -0700
          Re: Local database library Martin Gregorie <martin@address-in-sig.invalid> - 2013-10-02 19:49 +0000
            Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-04 10:48 -0700
              Re: Local database library Martin Gregorie <martin@address-in-sig.invalid> - 2013-10-05 15:43 +0000
                Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-05 11:19 -0700
          Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-02 22:05 -0400
            Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-04 10:57 -0700
              Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-04 22:00 -0400
                Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-05 11:28 -0700
                Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-05 15:15 -0400
                Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-05 12:49 -0700
  Re: Local database library "John B. Matthews" <nospam@nospam.invalid> - 2013-10-02 15:37 -0400
    Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-04 11:02 -0700
      Re: Local database library Lew <lewbloch@gmail.com> - 2013-10-04 15:56 -0700
        Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-05 12:06 -0700
          Re: Local database library Lew <lewbloch@gmail.com> - 2013-10-15 16:41 -0700
            Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-26 12:08 -0700
              Re: Local database library Martin Gregorie <martin@address-in-sig.invalid> - 2013-10-26 21:04 +0000
                Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-26 18:58 -0700
              Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-26 18:39 -0400
                Re: Local database library Kevin Nathan <knathan@project54.com> - 2013-10-26 19:04 -0700
            Re: Local database library Arne Vajhøj <arne@vajhoej.dk> - 2013-10-26 18:33 -0400

csiph-web