comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* license question? - viral nature of GPL - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d7680dfef2acffd6
* Am I the only one who questions JSTL, Struts Tags, XSL Tags? - 7 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d
* JProgressBar .... need assistance please.. - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b7d360120abff16
* problem with jboss startguide tutorial (dukes bank app) - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f1c074d82599e1f0
* building an object index - data structure question - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a06239c8e3bcc672
* Stuck on a caching issue. - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9caf57d6aa519122
* Problem using getQuery() method - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b02c8cd3ca328220
* Difference between Statement and preparedStatement (for SQL databases) ? - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4e84745752ae8768
* java server causes complete server shutdown - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3edf62239637e1ba
* Challenge: Triangles puzzle - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0
* DOM parsing - Document root element is missing. - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f08ad4f7dca18bf2
  
==========================================================================
TOPIC: license question? - viral nature of GPL
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d7680dfef2acffd6
==========================================================================

== 1 of 4 ==
Date:   Sun,   Oct 17 2004 2:15 pm
From: [EMAIL PROTECTED] (Bill Unruh) 

"Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> writes:

]In <[EMAIL PROTECTED]>, on 10/15/2004
]   at 09:06 AM, [EMAIL PROTECTED] (Steve Schefter) said:

]>    Linus opinion on this is irrelevant. Neither I nor the FSF nor
]>    many others have released code under anything but the vanilla GPL.
]>    By merging such code Linus lost his ability to vary the license.

]What do you mean by "such code"? What code is Linus distributing under
]the kernel GPL that he does not have the right to so distribute? Don't
]confuse Linux with a Linux distribution. 

The code written by all of the people who contribute to the kernel.
Very little is actually written by Linus.
He has the right to distribute it because it is licensed to him under the
GPL. That means he has to abide by the conditions of the GPL just as anyone
else must-- unless each of those writers licensed it to him under some
other license.




== 2 of 4 ==
Date:   Sun,   Oct 17 2004 4:12 pm
From: [EMAIL PROTECTED] (Malcolm Dew-Jones) 

Bill Unruh ([EMAIL PROTECTED]) wrote:
: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> writes:

: ]In <[EMAIL PROTECTED]>, on 10/15/2004
: ]   at 09:06 AM, [EMAIL PROTECTED] (Steve Schefter) said:

: ]>    Linus opinion on this is irrelevant. Neither I nor the FSF nor
: ]>    many others have released code under anything but the vanilla GPL.
: ]>    By merging such code Linus lost his ability to vary the license.

: ]What do you mean by "such code"? What code is Linus distributing under
: ]the kernel GPL that he does not have the right to so distribute? Don't
: ]confuse Linux with a Linux distribution. 

: The code written by all of the people who contribute to the kernel.
: Very little is actually written by Linus.
: He has the right to distribute it because it is licensed to him under the
: GPL. That means he has to abide by the conditions of the GPL just as anyone
: else must

May yes, maybe no.

You might think that when he distributes code in the kernel that he did
not himself write, then yes, he would need to abide by the gpl, whereas
for those things which he wrote himself, no, he could take them out of the
current kernel and use them anyway he wants.

However the gpl really controls how those _contributors_ could distribute
linus's work after they modify it, not how the original author can
distribute the work after incorporating code that has been sent to him in
the hopes he finds it useful.

Many people who contributed did not do anything that could be considered a
"distribution" when they provided it, instead they "contributed" the code
directly to him, effectively making a donation, not a distribution - and
so for those sections of code, linux may very well be able to change the
license more than the contributors may realize.  More importantly, many
contributions are modifications to code that linus originally wrote, and
copyright law is pretty clear that the original author would normally own
those modifications no matter who made them.  For examples outside of
source code, consider if you rearrange and expand on someone elses short
story then the original author can claim copyright infringement - i.e.
they own the copyright on the new work because it is based on their work,
even though they didn't write most of it (there are lawsuits all the time
over film scripts that fall into this kind of category), or in music, if
you make an arrangement of a song then the original author explicitly owns
the copyright in the arrangement (even though they didn't write it).  
Code is not inherently different, Linus likely does own the copyright in
much of the code that has been contributed, and can therefore distribute
it any way he chooses.

There will of course be situations where this would not be true, such as
any standalone utility that is not based on his code, but simply ties into
his code (and many contributions certainly fall into that category).

The above ignores the question of whether linus's code itself incorporates
gpl code that he has taken from distributions, effectively requiring him
to gpl everything no matter what anyways.



== 3 of 4 ==
Date:   Sun,   Oct 17 2004 3:23 pm
From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> 

John Thompson <[EMAIL PROTECTED]> writes:

> But sendmail is not licensed under the GPL:
> 
> http://www.sendmail.org/license-info.html

That wasn't the point, the point is that there are multiple licensing
options for it, at the authors' discretion.



== 4 of 4 ==
Date:   Sun,   Oct 17 2004 7:43 pm
From: [EMAIL PROTECTED] (Bill Unruh) 

[EMAIL PROTECTED] (Malcolm Dew-Jones) writes:

]Bill Unruh ([EMAIL PROTECTED]) wrote:
]: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> writes:

]: ]In <[EMAIL PROTECTED]>, on 10/15/2004
]: ]   at 09:06 AM, [EMAIL PROTECTED] (Steve Schefter) said:

]: ]>    Linus opinion on this is irrelevant. Neither I nor the FSF nor
]: ]>    many others have released code under anything but the vanilla GPL.
]: ]>    By merging such code Linus lost his ability to vary the license.

]: ]What do you mean by "such code"? What code is Linus distributing under
]: ]the kernel GPL that he does not have the right to so distribute? Don't
]: ]confuse Linux with a Linux distribution. 

]: The code written by all of the people who contribute to the kernel.
]: Very little is actually written by Linus.
]: He has the right to distribute it because it is licensed to him under the
]: GPL. That means he has to abide by the conditions of the GPL just as anyone
]: else must

]May yes, maybe no.

]You might think that when he distributes code in the kernel that he did
]not himself write, then yes, he would need to abide by the gpl, whereas
]for those things which he wrote himself, no, he could take them out of the
]current kernel and use them anyway he wants.

]However the gpl really controls how those _contributors_ could distribute
]linus's work after they modify it, not how the original author can
]distribute the work after incorporating code that has been sent to him in
]the hopes he finds it useful.

]Many people who contributed did not do anything that could be considered a
]"distribution" when they provided it, instead they "contributed" the code

?? what has "distribution" got to do with anything. They allowed Linus and
others to copy it. That is as far as their right goes. They can control
copying. 

]directly to him, effectively making a donation, not a distribution - and
]so for those sections of code, linux may very well be able to change the
]license more than the contributors may realize.  More importantly, many

No. Noone makes donations. Read the code.

]contributions are modifications to code that linus originally wrote, and
]copyright law is pretty clear that the original author would normally own
]those modifications no matter who made them.  For examples outside of

No. Utterly false. Such a work is a derived work and copyright resides in BOTH
the original author and the person who changes it. It cannot be copied
except under conditions that BOTH agree to.
 

]source code, consider if you rearrange and expand on someone elses short
]story then the original author can claim copyright infringement - i.e.
]they own the copyright on the new work because it is based on their work,
]even though they didn't write most of it (there are lawsuits all the time
]over film scripts that fall into this kind of category), or in music, if
]you make an arrangement of a song then the original author explicitly owns
]the copyright in the arrangement (even though they didn't write it).  

No he does not. He owns the copyright to the original work. He also jointly
with the arranger owns the copyright in the arrangement. Both have
copright and you need permission from both to copy.


]Code is not inherently different, Linus likely does own the copyright in
]much of the code that has been contributed, and can therefore distribute
]it any way he chooses.


Uh, perhaps you should read the kernel source code sometime. Almost all has
an explicit statement that the code is released under the GPL. It is NOT
"donated to Linus" nor is the copyright transfered to him. 
Let me take a random bit of code (this is the first file in the kernel tree
I opened)

/*
 *  linux/drivers/ide/ide-dma.c         Version 4.10    June 9, 2000
 *
 *  Copyright (c) 1999-2000     Andre Hedrick <[EMAIL PROTECTED]>
 *  May be copied or modified under the terms of the GNU General Public
 *  License
 */


Note that Andre Hedrick retains the copyright, and allows others to use it
under the GPL.





==========================================================================
TOPIC: Am I the only one who questions JSTL, Struts Tags, XSL Tags?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d
==========================================================================

== 1 of 7 ==
Date:   Sun,   Oct 17 2004 2:15 pm
From: Sudsy <[EMAIL PROTECTED]> 

Greg Smith wrote:
<snip>
> i hear you... it does seem to me that we're forgetting the lessons
> learned over the last 30 years of software engineering. to make
> multiple pages when one (plus a little logic) will do, increases the
> cost of maintenance. and maintenance is the most expensive phase of
> the life cycle. but that may be a different thread.
> 
> thanks for your help.

Ah, but that's why we have Tiles! Seriously, your observation is entirely
valid. A template framework such as Tiles addresses such issues. You use
the same template and only the contained elements need to change. Since
included elements can be defined as optional, you can program your servlet
to include those optional elements only in exceptional circumstances. So
you're back to one display page.
But now you've added another technology to the mix, increasing the
complexity on the development side. Maintenance gets a bit easier,
though.
It gets complicated, doesn't it?

ps. Tiles can be a very powerful addition to your tool kit. Templates can
     provide a consistent "look and feel" across an entire website, similar
     to what CSS can do for HTML pages.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 2 of 7 ==
Date:   Sun,   Oct 17 2004 2:45 pm
From: Steve Sobol <[EMAIL PROTECTED]> 

Sudsy wrote:

>> i hear you... it does seem to me that we're forgetting the lessons
>> learned over the last 30 years of software engineering. to make
>> multiple pages when one (plus a little logic) will do, increases the
> 
> Ah, but that's why we have Tiles! 

Or better yet, Sitemesh. Requires less work. Pages are automatically decorated. 
And since you're essentially using templates, you don't have to have the same 
code in several different places.

http://www.opensymphony.com/sitemesh/

**SJS (not affiliated; just a satisfied user of the product.)

-- 
JustThe.net Internet & New Media Services, http://JustThe.net/
Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED]
PGP Key available from your friendly local key server (0xE3AE35ED)
Apple Valley, California     Nothing scares me anymore. I have three kids.



== 3 of 7 ==
Date:   Sun,   Oct 17 2004 3:06 pm
From: "John Harlow" <[EMAIL PROTECTED]> 

>> Ah, but that's why we have Tiles!
>
> Or better yet, Sitemesh. Requires less work.

Or, if your server understands them, a good old "include" directive. 





== 4 of 7 ==
Date:   Sun,   Oct 17 2004 3:24 pm
From: Frank <[EMAIL PROTECTED]> 

Greg Smith wrote:
> i hear you... it does seem to me that we're forgetting the lessons
> learned over the last 30 years of software engineering. to make
> multiple pages when one (plus a little logic) will do, increases the
> cost of maintenance. and maintenance is the most expensive phase of
> the life cycle. but that may be a different thread.

Usually possible to express that logic in your model, though.
Even if it's just setting a simple flag, like the locical OR in that 
example upthread?

-Frank



== 5 of 7 ==
Date:   Sun,   Oct 17 2004 4:15 pm
From: Steve Sobol <[EMAIL PROTECTED]> 

John Harlow wrote:
>>>Ah, but that's why we have Tiles!
>>
>>Or better yet, Sitemesh. Requires less work.
> 
> 
> Or, if your server understands them, a good old "include" directive. 

I can't stand include directives. At least not as applied to site templating. 
The concept is just simply *broken.*

-- 
JustThe.net Internet & New Media Services, http://JustThe.net/
Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED]
PGP Key available from your friendly local key server (0xE3AE35ED)
Apple Valley, California     Nothing scares me anymore. I have three kids.



== 6 of 7 ==
Date:   Sun,   Oct 17 2004 7:04 pm
From: "John Harlow" <[EMAIL PROTECTED]> 

Steve Sobol wrote:
> John Harlow wrote:
>>>> Ah, but that's why we have Tiles!
>>>
>>> Or better yet, Sitemesh. Requires less work.
>>
>>
>> Or, if your server understands them, a good old "include" directive.
>
> I can't stand include directives. At least not as applied to site
> templating. The concept is just simply *broken.*

Interesting, why do you say that?  It works perfectly for me. 





== 7 of 7 ==
Date:   Sun,   Oct 17 2004 7:08 pm
From: Sudsy <[EMAIL PROTECTED]> 

Greg Smith wrote:
<snip>
> i hear you... it does seem to me that we're forgetting the lessons
> learned over the last 30 years of software engineering. to make
> multiple pages when one (plus a little logic) will do, increases the
> cost of maintenance. and maintenance is the most expensive phase of
> the life cycle. but that may be a different thread.
> 
> thanks for your help.

Greg,
    Based on the number of replies, it may indeed justify a new thread.
Seems that the concept is widespread, albeit with different implementations.
Which, in itself, suggests that there is some merit to the approach...

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: JProgressBar .... need assistance please..
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b7d360120abff16
==========================================================================

== 1 of 2 ==
Date:   Sun,   Oct 17 2004 2:25 pm
From: "Russell" <[EMAIL PROTECTED]> 

I'm playing with the idea of showing a JProgressBar in a small App' I trying
to make.
I want to display the progress of an array being populated....however I cant
seem to get the bar to show the actual % state before it reaches 100%
Am I missing something out?
Please help me if you can..

Thanks...

#######################
CODE BELOW
#######################

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ArrayRandom extends JFrame {
  protected final int size = 100000;
  protected int[] prodRandm = new int[size];
  protected int min = 0;
  protected int max = 100;
  protected JProgressBar progress;
  protected JButton start;

  public ArrayRandom() {
    setSize(300,50);
    progress = new JProgressBar();
    progress.setStringPainted(false);
    progress.setIndeterminate(true);

    start = new JButton("Start");
    ActionListener act = new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        progress.setMinimum(min);
        progress.setMaximum(max);
        progress.setIndeterminate(false);
        progress.setStringPainted(true);
        for (int i = 0; i < size; i++) {
          prodRandm[i] = i;
          progress.setValue((i/1000)+1);
          progress.setString((i/1000)+1+" %");
        }
      }
    };
    start.addActionListener(act);
    getContentPane().setLayout(new BorderLayout(10,10));
    getContentPane().add(progress, BorderLayout.CENTER);
    getContentPane().add(start, BorderLayout.WEST);
  }

  public static void main(String[] args) {
    ArrayRandom frame = new ArrayRandom();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
  }
}





== 2 of 2 ==
Date:   Sun,   Oct 17 2004 3:34 pm
From: Alex Hunsley <[EMAIL PROTECTED]> 

Russell wrote:
> I'm playing with the idea of showing a JProgressBar in a small App' I trying
> to make.
> I want to display the progress of an array being populated....however I cant
> seem to get the bar to show the actual % state before it reaches 100%
> Am I missing something out?
> Please help me if you can..
> 
> Thanks...
> 

Russell, please don't multipost (there is never any good reason to).

http://www.blakjak.demon.co.uk/mul_crss.htm

You question is much more suited to comp.lang.java.help, where I have 
answered it. In future it would be good to restrict similar questions to 
that newsgroup.

alex




==========================================================================
TOPIC: problem with jboss startguide tutorial (dukes bank app)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f1c074d82599e1f0
==========================================================================

== 1 of 1 ==
Date:   Sun,   Oct 17 2004 2:32 pm
From: Sudsy <[EMAIL PROTECTED]> 

Phoneix wrote:
> hello ,
>  i am getting the same error, 
> did u reslove it ? 
> 
> thanks in advance

But it's telling you the exact problem in the error message!
Look here:

"http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml
or the jar files deployed with this application"

So you must have a JSP file containing something like this:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>

Now look at your web.xml file. It SHOULD have an element like this:

   <taglib>
     <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
     <taglib-location>/path/to/core.tld</taglib-location>
   </taglib>

But it probably doesn't. Adding it (in the right place; refer to the
DTD) should solve your problem.

Note that this requirement is specific to your JBoss implementation;
WebSphere and WebLogic are smart enough to actually go out to the 'net
and pull the TLD since the protocol is specified in the URI. I seem to
recall that Tomcat might even resolve it internally, at least the newer
versions...

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: building an object index - data structure question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a06239c8e3bcc672
==========================================================================

== 1 of 2 ==
Date:   Sun,   Oct 17 2004 3:11 pm
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Raj wrote:

>>The best way would be to include the search criteria in the DB query
>>in the first place. THAT'S WHAT A DB IS FOR!!!
> 
> I have to look up this object map several hundred / thousand times for
> every time this program is executed (which runs in a batch fashion)
> and so I need this data structure in memory so as to save needless
> database calls.

Are you sure these DB calls really are "needless", i.e. would be slower
than doing work that a DB is optimized for in your own code? I find that
assumption highly dubious.  Actually, If the work consists of simple
lookups on fields, then it should be possible to get the entire result
with a DB query whose resultset just contains the data you're interested
in. But...


> and besides, making changes to the stored procedures
> returning the data is not an option in the current development
> environment due to political and other reasons.

...of course it's possible that artificial restrictions prevent a sane
solution.



== 2 of 2 ==
Date:   Sun,   Oct 17 2004 3:33 pm
From: Sudsy <[EMAIL PROTECTED]> 

Michael Borgwardt wrote:
> Raj wrote:
<snip>
> Are you sure these DB calls really are "needless", i.e. would be slower
> than doing work that a DB is optimized for in your own code? I find that
> assumption highly dubious.  Actually, If the work consists of simple
> lookups on fields, then it should be possible to get the entire result
> with a DB query whose resultset just contains the data you're interested
> in. But...
<snip> 
> ...of course it's possible that artificial restrictions prevent a sane
> solution.

How about a combination of the two? Store the objects (I get the impression
that they're large, hence no desire to keep fetching from DB) and then
perform lookups which merely return the primary key of the records of
interest?
SELECT * FROM table and put into a HashMap where the primary key of the
record is the key for the HashMap and the value is a value-object
containing the record details.
SELECT pk FROM table WHERE condition and use the pk (primary key) values
in the ResultSet in HashMap#get.
A tad complex but it would seem like a fair division of labour.
Then again, without a more complete description of the situation this is
merely conjecture.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: Stuck on a caching issue.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9caf57d6aa519122
==========================================================================

== 1 of 1 ==
Date:   Sun,   Oct 17 2004 3:36 pm
From: Alex Hunsley <[EMAIL PROTECTED]> 

Inertia_sublimation wrote:

> Also, please forgive the amount of code I'm posting, I think all of it
> is pertinant though.

Just one thing for now: post compilable code. What you posted isn't 
compilable, as it has been line-broken and I can see comments spill over 
onto the next line etc.
Also, when posting a pretty large bit of code, consider placing it on a 
web server or ftp server if you have one!




==========================================================================
TOPIC: Problem using getQuery() method
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b02c8cd3ca328220
==========================================================================

== 1 of 2 ==
Date:   Sun,   Oct 17 2004 4:58 pm
From: [EMAIL PROTECTED] (Nelson Broat) 

When url="http://www.example.com?a=b";;

& I use either:

    URLConnection url_connection = null;
    url_connection = WebData.getConnection(url);
    HttpURLConnection http_connection = null;
    http_connection = (HttpURLConnection)url_connection;

both url_connection & http_connection are both equal to the returned
url. Which is fine. For sake of argument that url is: 
http://www.returnedurl.com?x=y

My problem is that I want to grab the parameters that are being
returned (in this case x), but the only way I know of to do this is
with the getQuery method.
As in:

String querypart = getQuery(http_connection);  or even url_connection
out.println(querypart);

But I continue to receive errors because the argument passed in
getQuery is not a String datatype. I.E. - If url had been passed to
the getQuery method, then
querypart="x=y".

Ideas, thoughts, comments? Any help is appreciated thanks.

Nelson



== 2 of 2 ==
Date:   Sun,   Oct 17 2004 5:20 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 17 Oct 2004 16:58:32 -0700, Nelson Broat wrote:

> When url="http://www.example.com?a=b";;
> 
> & I use either:
> 
>     URLConnection url_connection = null;
>     url_connection = WebData.getConnection(url);

What's a 'WebData'?

>     HttpURLConnection http_connection = null;
>     http_connection = (HttpURLConnection)url_connection;
> 
> both url_connection & http_connection are both equal to the returned
> url. Which is fine. For sake of argument that url is: 
> http://www.returnedurl.com?x=y
> 
> My problem is that I want to grab the parameters that are being
> returned (in this case x), but the only way I know of to do this is
> with the getQuery method.

What?  As in URL.getQuery(), or URI.getQuery()?

> As in:
> 
> String querypart = getQuery(http_connection);  

Where does that method come from?  I do not see a getQuery()
that accepts parameters in either the J2SE or J2EE.

>..or even url_connection
> out.println(querypart);
> 
> But I continue to receive errors 

What error *exactly*?
<http://www.physci.org/codes/javafaq.jsp#exact>

>..because the argument passed in
> getQuery is not a String datatype. I.E. - If url had been passed to
> the getQuery method, then
> querypart="x=y".
> 
> Ideas, thoughts, comments? Any help is appreciated thanks.

Post an SSCCE.
<http://www.physci.org/codes/sscce.jsp>
..and explain what the heck a 'WebData' is, for good measure.

BTW - it is not a good idea to cross-post between c.l.j.p and
c.l.j.h., these are very different groups where the same question
might generate radically different answers.  I strongly recommend
you stick to c.l.j.help for the moment.

Follow-Ups set to c.l.j.help.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Difference between Statement and preparedStatement (for SQL databases) ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4e84745752ae8768
==========================================================================

== 1 of 2 ==
Date:   Sun,   Oct 17 2004 5:40 pm
From: [EMAIL PROTECTED] (Michael Fortin) 

[EMAIL PROTECTED] (Ken Philips) wrote in message news:<[EMAIL PROTECTED]>...
> Sometimes I can see pure Statement declaration for accessing SQL databases
> others use preparedStatements.
> 
> What is the difference?
> 
> Ken

exerpt from http://www.oreilly.com/catalog/jorajdbc/chapter/ch19.html

"Statement Versus PreparedStatement

There's a popular belief that using a PreparedStatement object is
faster than using a Statement object. After all, a prepared statement
has to verify its metadata against the database only once, while a
statement has to do it every time. So how could it be any other way?
Well, the truth of the matter is that it takes about 65 iterations of
a prepared statement before its total time for execution catches up
with a statement. This has performance implications for your
application, and exploring these issues is what this section is all
about.

When it comes to which SQL statement object performs better under
typical use, a Statement or a PreparedStatement, the truth is that the
Statement object yields the best performance. When you consider how
SQL statements are typically used in an application--1 or 2 here,
maybe 10-20 (rarely more) per transaction--you realize that a
Statement object will perform them in less time than a
PreparedStatement object."



== 2 of 2 ==
Date:   Sun,   Oct 17 2004 6:03 pm
From: Luke Webber <[EMAIL PROTECTED]> 

Michael Fortin wrote:

> exerpt from http://www.oreilly.com/catalog/jorajdbc/chapter/ch19.html
> 
> "Statement Versus PreparedStatement
> 
> There's a popular belief that using a PreparedStatement object is
> faster than using a Statement object. After all, a prepared statement
> has to verify its metadata against the database only once, while a
> statement has to do it every time. So how could it be any other way?
> Well, the truth of the matter is that it takes about 65 iterations of
> a prepared statement before its total time for execution catches up
> with a statement. This has performance implications for your
> application, and exploring these issues is what this section is all
> about.
> 
> When it comes to which SQL statement object performs better under
> typical use, a Statement or a PreparedStatement, the truth is that the
> Statement object yields the best performance. When you consider how
> SQL statements are typically used in an application--1 or 2 here,
> maybe 10-20 (rarely more) per transaction--you realize that a
> Statement object will perform them in less time than a
> PreparedStatement object."

While I find O'Reilly a very good publisher, I take some issue with the 
above. The performance of a PreparedStatement is very definitely 
implementation-dependent, and not to be dismissed so lightly.

Luke




==========================================================================
TOPIC: java server causes complete server shutdown
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3edf62239637e1ba
==========================================================================

== 1 of 1 ==
Date:   Sun,   Oct 17 2004 5:59 pm
From: [EMAIL PROTECTED] (julia) 

Hello,

I am not sure if this is a java problem or a redhat problem.

I am running a chat server written in java called Bribble.  I have
java2 1.4 installed under Fedora 1.  When a client connects to this
server, at one point or another, several other daemons become
unresponsive.  The httpd, named, sshd servers all stop working.  Ping,
however, remains up.  Thus I know the box is still operational.  At
this point, I have to call my ISP to have the box rebooted.

Does anyone know what could be causing this problem?  I find it very
strange that such a small chat server program could do such damage. 
The chat server is started using: java -server -jar bribble.jar.  It
does some mysql work in the background as well.  I have read that this
may be related to IPv4/IPv6 issues.  But I was hoping someone could
give some insight or pointer to what the problem may be.

Thanks!
julia




==========================================================================
TOPIC: Challenge: Triangles puzzle
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0
==========================================================================

== 1 of 1 ==
Date:   Sun,   Oct 17 2004 7:33 pm
From: [EMAIL PROTECTED] (Tayssir John Gabbour) 

Frank Buss <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> [EMAIL PROTECTED] (Tayssir John Gabbour) wrote:
> 
> >> http://www.frank-buss.de/challenge/index.html
> > 
> > Would it be possible for you to have a private mailing list where you
> > can show us peoples' submissions? I'm too impatient to wait until the
> > 25th. The recipients can be people who already sent you solutions.
> 
> I've created a private submitters area and I'll send the access information 
> to every submitter of a working solution.

Thanks. It was interesting to see the differences in thought process.

Since I didn't do a good job of commenting (I just kicked it out),
I've sent you a commentary version that you might put next to my real
submission. It critiques my rough code a little, and gave some of my
background so readers know where I'm at.


MfG,
Tayssir




==========================================================================
TOPIC: DOM parsing - Document root element is missing.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f08ad4f7dca18bf2
==========================================================================

== 1 of 1 ==
Date:   Sun,   Oct 17 2004 8:03 pm
From: Rico <[EMAIL PROTECTED]> 

On Sun, 17 Oct 2004 15:39:17 +0000, xarax wrote:
> "Rico" <[EMAIL PROTECTED]> wrote in message
>> I don't really know how the XML is being produced but a space between the
>> last double-quote and the last '?' seems to solve the problem.
>> So does changing double-quotes to single-quotes.
 
> The first line of the XML file is not XML syntax.
> That's according to the rules of XML.
> 
> <?xml version='1.0' encoding='UTF-8' ?>
> 
> The first line above is an example of a correct
> XML header. It is *not* XML, because the keywords
> must be specified in the correct order. (Attribute
> keywords that appear within the XML body can be
> specified in any order.) I use single quotes in
> preference to double quotes, but the space appearing
> before the final ? is required.

Thanks for the input xarax. However, I don't think so, after checking,
that the space is required. The file is produced by a program written in
VB.Net and I am reading it using the Java DOM package.

For some reason, if I somehow modify and save the file before getting my
program to read it, the parsing goes fine. No missing root element or
anything. That's what was happening when I added the space, to match what
worked when I had been testing my program using my own files.

Any further pointers would be very much appreciated. Thanks.

Rico.



=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to