Search in sources :

Example 1 with DB

use of com.liferay.portal.kernel.dao.db.DB 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 DB

use of com.liferay.portal.kernel.dao.db.DB 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 DB

use of com.liferay.portal.kernel.dao.db.DB in project liferay-blade-samples by liferay.

the class CountryLocalServiceBaseImpl method runSQL.

/**
 * Performs a SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) {
    try {
        DataSource dataSource = countryPersistence.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 4 with DB

use of com.liferay.portal.kernel.dao.db.DB in project liferay-blade-samples by liferay.

the class FooServiceBaseImpl method runSQL.

/**
 * Performs a SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) {
    try {
        DataSource dataSource = fooPersistence.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 5 with DB

use of com.liferay.portal.kernel.dao.db.DB in project liferay-ide by liferay.

the class ClubLocalServiceBaseImpl method runSQL.

/**
 * Performs a SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) {
    try {
        DataSource dataSource = clubPersistence.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)

Aggregations

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