GeeCON Prague 2014*
The moose likes JDBC and the fly likes How to run database specific calls via jdbc? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to run database specific calls via jdbc?" Watch "How to run database specific calls via jdbc?" New topic
Author

How to run database specific calls via jdbc?

Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
How to run database specific calls via jdbc?
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
...?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

JDBC allows you to throw any string at the DB that you can, including database specific sql/dml. So if the database can execute the command ( proprietary of not ) it will. If it is DML or an update of some kind, use statement.executeUpdate( sql )just like you would a standard SQL92 query. There are no limitations on what can be put in your sql string. That only limitation is whether the database/driver implementation can handle the request.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Brusk Baran:
How to run database specific calls via jdbc?

Exactly the same as you run any query on a Database. Could you be a little more specific or ask the question a bit better? I'm not sure I fully understand the question.


GenRocket - Experts at Building Test Data
Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
ok you say : if the database and the driver of course supports any string command to be interpreted by the database engine; then it works.
I tried it and ok.
My problem was to make a sybase specific query. It was working on isql, the command based sql*plus -like tool, and wondered if I could use that command string just as is, without changing anything?
Thanks..
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

If you are passing the SQL string like
statement.executeQuery("sybase specific query string");
Then yes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run database specific calls via jdbc?