× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




    Hi Michael,

So I was just wondering if there was something similar to that in Java.

    That statement sort of doesn't compute.  The SQL is not dictated by
Java, it's that JDBC expects SQL.  You're trying to use something that would
be done in an SQL EXEC type statement or an environment that understands
multiple statements or a stored procedure.

    BTW, that's exactly the same case with ODBC.

    Having said that, if the DBMS engine, and sometimes the OS, can
understand what you're trying to do, Statement.execute() can run almost
anything.  It pretty much just hands off to the DBMS engine and says "handle
it."  If it can, it will.  If not, it chokes.

    JDBC is "just" a means of transmission and connection.

    Yep, it's SQL Server.

                                                         Joe Sam

Joe Sam Shirah -        http://www.conceptgo.com
conceptGO       -        Consulting/Development/Outsourcing
Java Filter Forum:       http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International?    http://www.jguru.com/faq/I18N
Que Java400?            http://www.jguru.com/faq/Java400


----- Original Message ----- 
From: <Michael_Schutte@xxxxxxxxxxxx>
To: "Java Programming on and around the iSeries / AS400"
<java400-l@xxxxxxxxxxxx>
Sent: Tuesday, February 13, 2007 11:53 AM
Subject: Re: JDBC help


 If exists(stmt.executeQuery)

    I'm not sure what you're mixing above, but Statement.executeQuery()
returns a ResultSet, not a boolean.  Unless you did it as a stored
procedure
that returned an OUT parameter, you'll need to do

Joe, thanks for your input.  I'll take a look at your examples.  I
realized
that .executeQuery always returns a resultset. What I was trying to get
at,
is that in PSQL or TSQL you can say.

If EXISTS(SELECT * FROM TABLE)
BEGIN
  -- do something
END

So I was just wondering if there was something similar to that in Java.
"SELECT 1 From Table" should work.  Thanks.

You are correct, I'm query a non DB2 table... it's Microsoft SQL I
believe...

url equals  jdbc:jtds:sqlserver://"+ipAddr+":1433/"+dbName

//Using jtds driver
Class.forName("net.sourceforge.jtds.jdbc.Driver");

if that means anything to you.


Michael Schutte
Admin Professional
For hotcake tips, interviews with our chefs and more, check out the
Stacked
and Stuffed blog at http://imstuffed.blogspot.com

-- 
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.