Which SQL commands can I issue with JDBC 
Author Message
 Which SQL commands can I issue with JDBC

Well I know about all the common ones, like SELECT, INSERT, DELETE etc.
But when I saw a few error messages I triggered which started to talk
about
CLI commands being issued under the covers I got to thinking.  I think I
have
read somewhere that CREATE TABLE commands can be issued, and maybe
even ALTER TABLE (and other things than TABLEs).  Can I for instance
when I have done a bulk load to a table issue a RUNSTAT?

I have not seen anything in any of the books I have read which indicate
there
are limits, but I have not read the formal JDBC spec.  Is this driver
dependant
or is this going to work more widely.  In particular what does DB2
support
and it is platform and/or release dependant, and does it differ between
the
.net. and the .app. driver?

  david.goodenough.vcf
< 1K Download


Sun, 24 Aug 2003 07:05:24 GMT
 Which SQL commands can I issue with JDBC

David.

you should be able to execute all SQL statements (as defined in the DB2 SQL
Reference) in JDBC .
RUNSTATS however, is a DB2 command and is defined in the DB2 Command
Reference. All these commands can't be executed from JDBC.

If you get a CLI error, then most likely there's a syntax error in your SQL
statement or the JDBC calling sequence is wrong. Which error do you see?
You can search for this error (something like SQLN12345 or CLI12345) on
http://www.deja.com  . Most likely this has been discussed here before and
you should find the problem without posting you code.

Regards, Dirk


Quote:
> Well I know about all the common ones, like SELECT, INSERT, DELETE etc.
> But when I saw a few error messages I triggered which started to talk
> about
> CLI commands being issued under the covers I got to thinking.  I think I
> have
> read somewhere that CREATE TABLE commands can be issued, and maybe
> even ALTER TABLE (and other things than TABLEs).  Can I for instance
> when I have done a bulk load to a table issue a RUNSTAT?

> I have not seen anything in any of the books I have read which indicate
> there
> are limits, but I have not read the formal JDBC spec.  Is this driver
> dependant
> or is this going to work more widely.  In particular what does DB2
> support
> and it is platform and/or release dependant, and does it differ between
> the
> .net. and the .app. driver?



Sun, 24 Aug 2003 08:53:33 GMT
 Which SQL commands can I issue with JDBC

Quote:

> David.

> you should be able to execute all SQL statements (as defined in the DB2 SQL
> Reference) in JDBC .
> RUNSTATS however, is a DB2 command and is defined in the DB2 Command
> Reference. All these commands can't be executed from JDBC.

Excellent, it is however odd that all the books I have read do not seem to
mention
this.  Is this true (preferably because it is defined to be) of all
JDBC drivers or
just the DB/2 ones.

Quote:

> If you get a CLI error, then most likely there's a syntax error in your SQL
> statement or the JDBC calling sequence is wrong. Which error do you see?
> You can search for this error (something like SQLN12345 or CLI12345) on
> http://www.deja.com  . Most likely this has been discussed here before and
> you should find the problem without posting you code.

I had actually already fixed my problems, I just noticed that the error
messages
mentioned CLI and that is what set me thinking, but thats for the pointer
anyway.
Quote:

> Regards, Dirk



> > Well I know about all the common ones, like SELECT, INSERT, DELETE etc.
> > But when I saw a few error messages I triggered which started to talk
> > about
> > CLI commands being issued under the covers I got to thinking.  I think I
> > have
> > read somewhere that CREATE TABLE commands can be issued, and maybe
> > even ALTER TABLE (and other things than TABLEs).  Can I for instance
> > when I have done a bulk load to a table issue a RUNSTAT?

> > I have not seen anything in any of the books I have read which indicate
> > there
> > are limits, but I have not read the formal JDBC spec.  Is this driver
> > dependant
> > or is this going to work more widely.  In particular what does DB2
> > support
> > and it is platform and/or release dependant, and does it differ between
> > the
> > .net. and the .app. driver?

  david.goodenough.vcf
< 1K Download


Sun, 24 Aug 2003 17:09:44 GMT
 Which SQL commands can I issue with JDBC
This is true because it is part of the JDBC specification:

JDBC 1.2 specification:
http://www.javasoft.com/products/jdk/1.2/docs/guide/jdbc/spec/jdbc-sp...

JDBC 2.0 specification:
http://www.javasoft.com/products/jdk/1.2/docs/guide/jdbc/spec2/jdbc2....

See also the API documentation for whatever version of the JDK you are
using.

Any non-SQL database commands that can be issued through a JDBC driver
would, I think, be non-standard vendor extensions. Of course, to
accomplish what you're asking, you could probably write a stored
procedure that issues a system("runstats") call, and then call that
stored procedure from a JDBC CallableStatement object...

Dan

Quote:


>> David.

>> you should be able to execute all SQL statements (as defined in the DB2 SQL
>> Reference) in JDBC .
>> RUNSTATS however, is a DB2 command and is defined in the DB2 Command
>> Reference. All these commands can't be executed from JDBC.

> Excellent, it is however odd that all the books I have read do not seem to
> mention
> this.  Is this true (preferably because it is defined to be) of all
> JDBC drivers or
> just the DB/2 ones.

>> If you get a CLI error, then most likely there's a syntax error in your SQL
>> statement or the JDBC calling sequence is wrong. Which error do you see?
>> You can search for this error (something like SQLN12345 or CLI12345) on
>> http://www.deja.com  . Most likely this has been discussed here before and
>> you should find the problem without posting you code.

> I had actually already fixed my problems, I just noticed that the error
> messages
> mentioned CLI and that is what set me thinking, but thats for the pointer
> anyway.

>> Regards, Dirk



>>> Well I know about all the common ones, like SELECT, INSERT, DELETE etc.
>>> But when I saw a few error messages I triggered which started to talk
>>> about
>>> CLI commands being issued under the covers I got to thinking.  I think I
>>> have
>>> read somewhere that CREATE TABLE commands can be issued, and maybe
>>> even ALTER TABLE (and other things than TABLEs).  Can I for instance
>>> when I have done a bulk load to a table issue a RUNSTAT?

>>> I have not seen anything in any of the books I have read which indicate
>>> there
>>> are limits, but I have not read the formal JDBC spec.  Is this driver
>>> dependant
>>> or is this going to work more widely.  In particular what does DB2
>>> support
>>> and it is platform and/or release dependant, and does it differ between
>>> the
>>> .net. and the .app. driver?



Sun, 24 Aug 2003 23:42:27 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Fix issuing of multiple command completions per command

2. Issuing ROLLBACK command from SQL Server using MTS

3. SQL 2000 JDBC connection issue

4. MS-SQL 2000 JDBC Driver issues with IBM WebSphere

5. SQL server jdbc driver issues with UTF8 and NVARCHAR

6. JDBC SQL JOIN Issues

7. Single Quote issue within Dynamic SQL in JDBC

8. Performance issues - WebLogic JDBC driver to MS-SQL

9. execute sql EXPORT command from JDBC Java program

10. execute sql EXPORT command from JDBC Java program

11. sql command to run sql commands in file


 
Powered by phpBB® Forum Software