Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run database specific calls via jdbc?

 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to run database specific calls via jdbc?
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...?
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are passing the SQL string like
statement.executeQuery("sybase specific query string");
Then yes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic