use of com.serotonin.db.spring.ExtendedJdbcTemplate in project ma-core-public by infiniteautomation.
the class MailingListDao method saveMailingList.
public void saveMailingList(final MailingList ml) {
final ExtendedJdbcTemplate ejt2 = ejt;
getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
@SuppressWarnings("synthetic-access")
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
if (ml.getId() == Common.NEW_ID) {
ml.setId(doInsert(MAILING_LIST_INSERT, new Object[] { ml.getXid(), ml.getName(), ml.getReceiveAlarmEmails() }));
countMonitor.increment();
} else
ejt2.update(MAILING_LIST_UPDATE, new Object[] { ml.getXid(), ml.getName(), ml.getReceiveAlarmEmails(), ml.getId() });
saveRelationalData(ml);
}
});
}
use of com.serotonin.db.spring.ExtendedJdbcTemplate in project ma-core-public by infiniteautomation.
the class MySQLProxy method getDataDirectory.
@Override
public File getDataDirectory() {
ExtendedJdbcTemplate ejt = new ExtendedJdbcTemplate();
ejt.setDataSource(this.getDataSource());
String dataDir = ejt.queryForObject("select @@DATADIR", new Object[] {}, String.class, null);
if (dataDir == null)
return null;
return new File(dataDir);
}
Aggregations