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


Groups > comp.lang.java.programmer > #14057 > unrolled thread

Apache JDBC utils

Started bymarkspace <-@.>
First post2012-04-30 14:55 -0700
Last post2012-05-03 01:49 +0200
Articles 8 on this page of 48 — 8 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Apache JDBC utils markspace <-@.> - 2012-04-30 14:55 -0700
    Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-30 20:56 -0300
      Re: Apache JDBC utils markspace <-@.> - 2012-04-30 17:50 -0700
    Re: Apache JDBC utils Lew <lewbloch@gmail.com> - 2012-04-30 18:03 -0700
      Re: Apache JDBC utils markspace <-@.> - 2012-04-30 19:27 -0700
        Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-01 10:29 -0300
          Re: Apache JDBC utils markspace <-@.> - 2012-05-01 08:57 -0700
            Re: Apache JDBC utils Lew <lewbloch@gmail.com> - 2012-05-02 11:16 -0700
              Re: Apache JDBC utils markspace <-@.> - 2012-05-03 07:51 -0700
      Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-01 19:22 -0400
    Re: Apache JDBC utils Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-01 10:32 -0700
      Re: Apache JDBC utils markspace <-@.> - 2012-05-01 11:22 -0700
        Re: Apache JDBC utils Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-01 15:26 -0700
          Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-01 19:44 -0300
    Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-01 19:26 -0400
      Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-01 21:14 -0300
        Re: Apache JDBC utils Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-01 22:22 -0500
          Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 13:52 -0400
        Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 13:51 -0400
          Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-03 17:11 -0300
            Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 16:58 -0400
              Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-03 18:25 -0300
                Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 19:55 -0400
      Re: Apache JDBC utils Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-01 22:08 -0500
        Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 13:55 -0400
          Re: Apache JDBC utils Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-03 13:44 -0500
            Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 15:06 -0400
    Re: Apache JDBC utils "John B. Matthews" <nospam@nospam.invalid> - 2012-05-01 23:37 -0400
      Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-02 07:37 -0300
        Re: Apache JDBC utils "John B. Matthews" <nospam@nospam.invalid> - 2012-05-02 18:51 -0400
    Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-02 12:22 +0200
      Re: Apache JDBC utils markspace <-@.> - 2012-05-02 08:29 -0700
        Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-02 22:02 +0200
          Re: Apache JDBC utils Lew <lewbloch@gmail.com> - 2012-05-02 14:22 -0700
            Re: Apache JDBC utils Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-02 18:53 -0300
            Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 00:03 +0200
              Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 00:14 +0200
              Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 00:27 +0200
                Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 14:03 -0400
              Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-02 18:58 -0400
              Re: Apache JDBC utils Lew <lewbloch@gmail.com> - 2012-05-02 16:18 -0700
            Re: Apache JDBC utils Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-02 15:25 -0700
              Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 00:59 +0200
                Re: Apache JDBC utils Arne Vajhøj <arne@vajhoej.dk> - 2012-05-03 14:05 -0400
              Re: Apache JDBC utils Lew <lewbloch@gmail.com> - 2012-05-02 16:24 -0700
                Re: Apache JDBC utils Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-02 16:35 -0700
                Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 01:46 +0200
                Re: Apache JDBC utils Jan Burse <janburse@fastmail.fm> - 2012-05-03 01:49 +0200

Page 3 of 3 — ← Prev page 1 2 [3]


#14168

FromLew <lewbloch@gmail.com>
Date2012-05-02 16:18 -0700
Message-ID<31980135.2149.1336000704354.JavaMail.geo-discussion-forums@pbcvn7>
In reply to#14158
On Wednesday, May 2, 2012 3:03:57 PM UTC-7, Jan Burse wrote:
> Lew schrieb:
> > Scriptlet in JSP is an antipattern.
> 
> No,
> Java EE 6 calls it even "deprecated".
> 
> But advantage of JSP is that it is readily
> available. And its actually very old, already
> around 1990. But you will not hear some praise
> of it from me.

That "but" has nothing to do with the inadvisability of putting scriptlet in JSP.

Nor do the advantages or disadvantages JSP have anything to do with the advisability of scriptlet therein.

The age of JSP is even less relevant. Java is older than JSP and no one is suggesting we not use Java, either.

> It has more been a conceptual issue in
> matula how to generate XXXBean. But you
> can  of course plug-in your preffered
> template language in the below flow:
> 
> +--------+     +-------------+
> |   DB   |     | .properties |
> +--------+     +-------------+
>      |                |
>      ------      -----
>           |      |
>           v      v
>          +--------+
>          |>>Here<<|
>          +--------+
>               |
>               v
>         +------------+
>         |  XXXBean   |
>         +------------+
> 
> Now I am waiting for a post that says
> .properties files are an anti pattern.
> Which I can also agree upon. So the
> point of the .properties files here is
> to provide annotation of the DB schema.
> 
> Of course one can also use here anything
> else than .properties files that allows
> for peristence or input of some
> annotations. So the flow is basically
> as follows:
> 
> +--------+     +-------------+
> |   DB   |     | >> Here 2 <<|
> +--------+     +-------------+
>      |                |
>      ------      -----
>           |      |
>           v      v
>         +-----------+
>         |>>Here 1 <<|
>         +-----------+
>               |
>               v
>         +------------+
>         |  XXXBean   |
>         +------------+

Why in the world would someone consider properties files an antipattern?

Don't use scriptlet in JSPs.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#14160

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-05-02 15:25 -0700
Message-ID<kvior.21917$em4.13812@newsfe21.iad>
In reply to#14152
On 5/2/12 2:22 PM, Lew wrote:
> Jan Burse wrote:
>> *NO* reflection API was used at all, *NO* injection
>> pattern was used, also no penguins where harmed. The
>> framework consists of what would one call XDoclet today.
>>
>> But instead of XDoclet I use JSP to generate via
>> its output the Java code for the XXXBeans. The
>> input are some property files and the JDBC access
>> to the meta data of the already existing DB.
>>
>> +--------+     +-------------+
>> |   DB   |     | .properties |
>> +--------+     +-------------+
>>       |                |
>>       ------      -----
>>            |      |
>>            v      v
>>           +--------+
>>           |  JSP   |
>>           +--------+
>>                |
>>                v
>>          +------------+
>>          |  XXXBean   |
>>          +------------+
>>
>> Some part of the framework deals with invoking JSP
>> without browser attention in kind of batch mode. But
>> using JSP to generate Java code is straight forward.
>> Check out genbean.jsp, it starts with:
>>
>> public class<%=table%>Bean extends util.bean.BeanUtil {
>>     private util.bean.ColumnDescriptor[] columndescriptors;
>>
>> And as you might expect it can generate Java code and
>> place what table has a value in front of Bean. Or something
>> more elaborate:
>>
>> <%
>>     generator.bean.Column col=new generator.bean.Column();
>>     col.setTable(tab);
>>     col.list();
>>     while (col.next()) {
>> %>   private<%=col.getType()%>  <%=col.getName()%>=<%=col.getNullConst()%>;
>> <%
>>     }
>>     col.close();
>> %>
>>
>> The above iterates through the columns of the given table,
>> and the generates variable declarations.
>
> Scriptlet in JSP is an antipattern.
>

He's using a JSP to generate a Java source file, and your complaint is 
about scriptlets?

[toc] | [prev] | [next] | [standalone]


#14166

FromJan Burse <janburse@fastmail.fm>
Date2012-05-03 00:59 +0200
Message-ID<jnse92$2nm$1@news.albasani.net>
In reply to#14160
Daniel Pitts schrieb:
> He's using a JSP to generate a Java source file,
 > and your complaint is about scriptlets?

Yes, the argument that goes against <% %> since
they are not true XML tags doesn't work since
the Java source files are generated as
text/plain.

But a template language could nevertheless
be used that is based on XML. Only problem
here is if one wants to generate an instruction
from the template language itself. Which is
normaly not the case for Java code, since it
has hardly raw XML.

But In general the problem is agravated whenever
one wants to use a template language X to generate
code in the same template language X. For example
in a couple of places I use JSP to generate JSP.
The workaround here is to define a custom tag
that generates the <% and %>.

Here is the code for this Taglet:

/**
  * <p>This tag generates the <% %> pair.
  *
  * <p>Matula 1.3 (a beans and jsp generator)
  * <br>GPL 2003-2005, Jan Burse, XLOG Switzerland
  */
public class ScriptJava
     extends TagSupport {

   public int doStartTag() throws JspException {
     try {
       pageContext.getOut().print("<%");
     }
     catch (IOException x) {
       throw new JspException(x);
     }
     return TagSupport.EVAL_BODY_INCLUDE;
   }

   public int doEndTag() throws JspException {
     try {
       pageContext.getOut().print("%>");
     }
     catch (IOException x) {
       throw new JspException(x);
     }
     return TagSupport.EVAL_PAGE;
   }

}

Bye

[toc] | [prev] | [next] | [standalone]


#14205

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-05-03 14:05 -0400
Message-ID<4fa2c8e7$0$293$14726298@news.sunsite.dk>
In reply to#14166
On 5/2/2012 6:59 PM, Jan Burse wrote:
> Daniel Pitts schrieb:
>> He's using a JSP to generate a Java source file,
>  > and your complaint is about scriptlets?
>
> Yes, the argument that goes against <% %> since
> they are not true XML tags doesn't work since
> the Java source files are generated as
> text/plain.

<% %> and <jsp:scriptlet></jsp:scriptlet> are equally
frowned upon.

Arne

[toc] | [prev] | [next] | [standalone]


#14171

FromLew <lewbloch@gmail.com>
Date2012-05-02 16:24 -0700
Message-ID<31249482.1451.1336001051379.JavaMail.geo-discussion-forums@pbcwi8>
In reply to#14160
Daniel Pitts wrote:
> Lew wrote:
>> Scriptlet in JSP is an antipattern.
>>
> 
> He's using a JSP to generate a Java source file, and your complaint is 
> about scriptlets?

Absolutely.

First, all JSPs are used to generate Java source files. That's how JSP works.

Also, there already are SQL tags available for JSP.

Finally, I don't see how the scriptlet is necessary. Please feel free to educate me; I've been wrong before.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#14172

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-05-02 16:35 -0700
Message-ID<3xjor.183352$s82.171024@newsfe10.iad>
In reply to#14171
On 5/2/12 4:24 PM, Lew wrote:
> Daniel Pitts wrote:
>> Lew wrote:
>>> Scriptlet in JSP is an antipattern.
>>>
>>
>> He's using a JSP to generate a Java source file, and your complaint is
>> about scriptlets?
>
> Absolutely.
>
> First, all JSPs are used to generate Java source files. That's how JSP works.
>
> Also, there already are SQL tags available for JSP.
>
> Finally, I don't see how the scriptlet is necessary. Please feel free to educate me; I've been wrong before.
>

JSP's are compiled into Java source files, that is different than using 
them to compile into Java source files which are executed to produce 
other Java source files. The fact that his JSP's *output* is a Java 
source file is what I think is containing badness.

Partially because JSPs aren't exactly "stand-alone" templates, they run 
in a servlet request.  Alternatives might be Freemarker templates, as an 
example.

[toc] | [prev] | [next] | [standalone]


#14174

FromJan Burse <janburse@fastmail.fm>
Date2012-05-03 01:46 +0200
Message-ID<jnsh0n$7fu$1@news.albasani.net>
In reply to#14171
Lew schrieb:
> Also, there already are SQL tags available for JSP.

Now you are confusing things. XXXBeans are generated
here not necessarely for later use inside JSP. Although
it is not excluded that XXXBeans are used inside
JSP. And in that sense they would rival SQL
tags. And since I don't know SQL tags so much, I
am not sure which would win over the other.

But since my XXXBeans are also design to do bulk
updated/delete and not only select, their application
domain is a little bit broader than information fusion
for a web page. They can also be used for short term
transaction in actionlets, for item transactions inside
batches, or whatever else requires SQL access to a
database for either querying or data manipulation.

The presentation layer of the application is actually
irrelevant. And of course one thing I did not yet
mention, for better performance the XXXBeans will use
some connection pooling.

But XXXBeans should be viewed as the very lowest layer
of database access, forming part of the storage layer of
an application. On top of it one can build the processing
layer of an application which would combine XXXBeans to
form higher serverices. Maybe they can be best compared
to DAOs or ADOs.

Bye

[toc] | [prev] | [next] | [standalone]


#14175

FromJan Burse <janburse@fastmail.fm>
Date2012-05-03 01:49 +0200
Message-ID<jnsh68$7fu$2@news.albasani.net>
In reply to#14171
Lew schrieb:
> First, all JSPs are used to generate Java source files. That's how JSP works.

Wow, he actually understood it wrong. Outch.

Probably a problem of round robin a lot of threads all the time.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.java.programmer


csiph-web