Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use JDBC to execute database command?  RSS feed

 
sam cheung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone please tell me if I use JDBC to execute database (non-query) command? For example, in MySQL, it has command like 'SHOW MASTER STATUS', Can I execute that thru JDBC? If yes, can you please point me to an example?

Thank you for any help.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36616
473
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam,
JDBC is used to execute queries (or DDL instructions.) You could use Runtime.exec() to call a shell script containing the database instruction.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!