Java Features (cont'd): web services + restrictions of JDBC = the downturn of Java?

R

Rick Osborn

First. I must say, after almost 6 years, I too am growing somewhat
disappointed with the way Sun is keeping up with the industry. I
don't want to sound too critical but JDBC, the primary data access
means, can only return one data type. (RS) With all of the datatypes
available via DB stored procedures, this is sole ingredient we have to
cook with. I, for one, would prefer we have another parameter tacked
on to the end of Callable/Prepared and other Statements. That is, the
datatype we'd like returned. Or the freedom to declare and pass in an
empty instance of our own (Value Object). Is this too error-prone?

Two. JAXP seems to be awesome with it's ability to plug in the
different parsers as you please. Very Open Source. Very cool. But
MS has the ability to code XML in "deep" and intrisically WITHIN their
applications. They based the whole .NET paradigm on it. Where's our
(and Sun's) response to that?

Is Java finding a comfortable place in second?

I also just looked at the glimpses for new v1.5. No amazing overhaul
to blow the doors off MS's 18 month dedication to XML (.NET). No type
checking for Arrays. Looked to this observer to be "bolt-on" add on's
to squelch .NET's "delegate" exclusivity.

Is this wrong, or are we investing in the wrong camp?
 
S

Sudsy

Rick said:
First. I must say, after almost 6 years, I too am growing somewhat
disappointed with the way Sun is keeping up with the industry. I
don't want to sound too critical but JDBC, the primary data access
means, can only return one data type. (RS) With all of the datatypes
available via DB stored procedures, this is sole ingredient we have to
cook with. I, for one, would prefer we have another parameter tacked
on to the end of Callable/Prepared and other Statements. That is, the
datatype we'd like returned. Or the freedom to declare and pass in an
empty instance of our own (Value Object). Is this too error-prone?
<snip>

I don't understand your complaint. Haven't you ever programmed
something like this:

int receiptNum = -1;
try {
Connection conn = getConnection( ... );
CallableStatement cs = conn.prepareCall(
"{?= call utils.getreceiptnumber() }" );
cs.registerOutParameter( 1, java.sql.Types.INTEGER );
ResultSet rs = cs.executeQuery();
if( rs.next() )
receiptNum = cs.getInt( 1 );
rs.close();
cs.close();
}
catch( Exception e ) {
...
}

So what's the problem?
 
R

Rick Osborn

means, can only return one data type. (RS) With all of the datatypes

I imagine a world like this:


ValueObject vo = new ValueObject();
int receiptNum = -1;

try {
Connection conn = getConnection( ... );
CallableStatement cs = conn.prepareCall(
"{?= call utils.getreceiptnumber() }" );
cs.registerOutParameter( 1, java.sql.Types.INTEGER, vo);
// extra parameter to specify
returned obj
vo = cs.executeQuery(); // returned in your own type
//if( rs.next() ) // no need to iterate
//receiptNum = cs.getInt( 1 );
rs.close();
cs.close();
}
catch( Exception e ) {
...
}


Would it be so hard? Tightly knit to underlying data, just like
PL/SQL stored procedures.
 
C

Chris Smith

Rick said:
I imagine a world like this:

ValueObject vo = new ValueObject();
CallableStatement cs = conn.prepareCall(
"{?= call utils.getreceiptnumber() }" );
cs.registerOutParameter( 1, java.sql.Types.INTEGER, vo);
vo = cs.executeQuery(); // returned in your own type
Would it be so hard? Tightly knit to underlying data, just like
PL/SQL stored procedures.

What's ValueObject? At first glance, it looks suspiciously like you're
trying to achieve an O/R mapper, and yes that's hard. For more limited
uses, though, this might be more achievable.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
R

Rick Osborn

In my applications, similar to an HttpSession object, only it gets
passed between layers of an application. Somewhat like OR mapping,
only not confined to only mapping the underlying datastore. Flexibly
accepting additions and and subtractions to the data as it
transgresses through layers of the app. (i.e. business -> service ->
data)

In one instance, we used Maps like this to allow "growability" between
the layers of the application. They were not restricted in size like
bean-wrapper or container, but knit to the data dealt with.

What I am hoping is, it would be nice if we could have an
out-of-the-box object which allows this sort of retrieval from the
start. Rather than everyone in IT having to perform the iterations
through resultset and parse into the container we'd like. It'd be
nice to have CallableStatement or PreparedStatement let us define this
from the DB call.

I've been looking but maybe there's an open source project that's
already taken this on ("Turbine"?). Maybe JCP might want to hear
about it?
Either way, I think we need to put this out, to push our choice of
language onward.
 
Z

znôrt

First. I must say, after almost 6 years, I too am growing somewhat
disappointed with the way Sun is keeping up with the industry. I
don't want to sound too critical but JDBC, the primary data access
means, can only return one data type. (RS) With all of the datatypes
available via DB stored procedures, this is sole ingredient we have to
cook with. I, for one, would prefer we have another parameter tacked
on to the end of Callable/Prepared and other Statements. That is, the
datatype we'd like returned. Or the freedom to declare and pass in an
empty instance of our own (Value Object). Is this too error-prone?

It is superfluous. That's what Recordset and it's functionality are
for. What you are actually asking for is a special case of
java.sql.CallableStatement.executeQuery that is specifically limited
to single value return, which will spare you 2 lines of code. This
only would make sense if you were to spend most of the time coding
such single return stored procedures, which is seldom the case. And if
it were, you could encapsulate this very easily. End of problem. Your
investment is safe :D
Two. JAXP seems to be awesome with it's ability to plug in the
different parsers as you please. Very Open Source. Very cool. But
MS has the ability to code XML in "deep" and intrisically WITHIN their
applications. They based the whole .NET paradigm on it. Where's our
(and Sun's) response to that?

Why should there be one? I expect Sun to support emerging
technologies, not imitate every nonsensic MS move, like this
XML-e.v.e.r.y.w.h.e.r.e stuff. I'm just happy they don't.

XML strength is inter-system communications. XML has a great deal more
uses, but there's no need to enforce consistent XML use in an actual
platform implementation. Au contraire, there are several issues where
XML simply isn't not only sub-optimal (grin), but definitely not
appropiate.
Is Java finding a comfortable place in second?

Who cares? This is no rat race. I would rather focus on technology
(Java AND .NET) and let other stuff for the newspapers. They make a
living from that, after all ;-)
I also just looked at the glimpses for new v1.5. No amazing overhaul
to blow the doors off MS's 18 month dedication to XML (.NET).

That's just fine :-D
No type
checking for Arrays. Looked to this observer to be "bolt-on" add on's
to squelch .NET's "delegate" exclusivity.

Don't get me wrong, but you're getting a bit paranoid, here. Java and
..NET are both here to stay, and are both valid technologies. .NET has
still to demonstrate it's a solid and vialble business solution, wich
no doubt I'd expect it will do in a few years. This want's time,
there's no other way. That's why they need (end enjoy) to emphasize
every single "feature" thay can come along with. Apart of this, Java
has proven to be a solid and productive platform, and .NET will do
too, so calm down.
Is this wrong,
Totally.

or are we investing in the wrong camp?

If you expect patforms to satisfy every single wish just to keep you
fancy, like those you're asking for, yes. Regardless of platform.

regards
znôrt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top