Create mssql trigger from java program

Is it possible to create a trigger from java using mssql jdbc driver?

I am having one audit trigger which is saved in a .sql file. The UI will show all the tables available in client db. Sometimes they need to enable the auditing for some specific tables, so I need to run the sql script by replacing the table name with the user selected one. The client needs this to be achieved from our java software. As I am new to JDBC, I am unable to figure this out. Any better ideas/help appreciated

  • Count consecutive duplicate values in SQL
  • INSERT or UPDATE table from another table with composite primary key
  • Find index of last occurrence of a sub-string using T-SQL
  • Query a database based on result of query from another database
  • Count number of days on_hire in JAN
  • identity from sql insert via jdbctemplate
  • Filtering executed SQL queries on application server
  • Thinking behind decision of database connection pool size
  • JDBC jar added to Classpath still receiving error
  • getting value from jDateChooser and saving to MS sql DB
  • How to execute a group of 'select count(*)' queries as a batch in Java?
  • One Solution collect form web for “Create mssql trigger from java program”

    Execute trigger creation SQL as a plain query. You may also need to wrap the SQL with exec('...') as mentioned in:

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.