Search in sources :

Example 1 with SqlUpdate

use of com.liferay.portal.kernel.dao.jdbc.SqlUpdate in project liferay-ide by liferay.

the class RosterMemberLocalServiceBaseImpl method runSQL.

/**
 * Performs a SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) {
    try {
        DataSource dataSource = rosterMemberPersistence.getDataSource();
        DB db = DBManagerUtil.getDB();
        sql = db.buildSQL(sql);
        sql = PortalUtil.transformSQL(sql);
        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql);
        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) SqlUpdate(com.liferay.portal.kernel.dao.jdbc.SqlUpdate) DB(com.liferay.portal.kernel.dao.db.DB) PortalException(com.liferay.portal.kernel.exception.PortalException) SystemException(com.liferay.portal.kernel.exception.SystemException) DataSource(javax.sql.DataSource)

Example 2 with SqlUpdate

use of com.liferay.portal.kernel.dao.jdbc.SqlUpdate in project liferay-ide by liferay.

the class RosterMemberServiceBaseImpl method runSQL.

/**
 * Performs a SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) {
    try {
        DataSource dataSource = rosterMemberPersistence.getDataSource();
        DB db = DBManagerUtil.getDB();
        sql = db.buildSQL(sql);
        sql = PortalUtil.transformSQL(sql);
        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql);
        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) SqlUpdate(com.liferay.portal.kernel.dao.jdbc.SqlUpdate) DB(com.liferay.portal.kernel.dao.db.DB) SystemException(com.liferay.portal.kernel.exception.SystemException) DataSource(javax.sql.DataSource)

Example 3 with SqlUpdate

use of com.liferay.portal.kernel.dao.jdbc.SqlUpdate in project liferay-ide by liferay.

the class ArtistServiceBaseImpl method runSQL.

/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = artistPersistence.getDataSource();
        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql, new int[0]);
        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) SqlUpdate(com.liferay.portal.kernel.dao.jdbc.SqlUpdate) SystemException(com.liferay.portal.kernel.exception.SystemException) DataSource(javax.sql.DataSource)

Example 4 with SqlUpdate

use of com.liferay.portal.kernel.dao.jdbc.SqlUpdate in project liferay-ide by liferay.

the class AlbumServiceBaseImpl method runSQL.

/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = albumPersistence.getDataSource();
        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql, new int[0]);
        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) SqlUpdate(com.liferay.portal.kernel.dao.jdbc.SqlUpdate) SystemException(com.liferay.portal.kernel.exception.SystemException) DataSource(javax.sql.DataSource)

Example 5 with SqlUpdate

use of com.liferay.portal.kernel.dao.jdbc.SqlUpdate in project liferay-ide by liferay.

the class KBArticleLocalServiceBaseImpl method runSQL.

/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = kbArticlePersistence.getDataSource();
        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql, new int[0]);
        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) SqlUpdate(com.liferay.portal.kernel.dao.jdbc.SqlUpdate) PortalException(com.liferay.portal.kernel.exception.PortalException) SystemException(com.liferay.portal.kernel.exception.SystemException) DataSource(javax.sql.DataSource)

Aggregations

SqlUpdate (com.liferay.portal.kernel.dao.jdbc.SqlUpdate)28 SystemException (com.liferay.portal.kernel.exception.SystemException)28 DataSource (javax.sql.DataSource)28 PortalException (com.liferay.portal.kernel.exception.PortalException)16 DB (com.liferay.portal.kernel.dao.db.DB)10