Package it.eng.spago.dbaccess.sql

Examples of it.eng.spago.dbaccess.sql.DataConnection


   * @return The Spago DataConnection Object
   *
   * @throws EMFInternalError the EMF internal error
   */
  public DataConnection getDataConnection(Connection con) throws EMFInternalError {
    DataConnection dataCon = null;
    try {
      Class mapperClass = Class.forName("it.eng.spago.dbaccess.sql.mappers.OracleSQLMapper");
      SQLMapper sqlMapper = (SQLMapper)mapperClass.newInstance();
      dataCon = new DataConnection(con, "2.1", sqlMapper);
    } catch(Exception e) {
      logger.error("Error while getting Data Source " + e);
      throw new EMFInternalError(EMFErrorSeverity.ERROR, "cannot build spago DataConnection object");
    }
    return dataCon;
View Full Code Here


    public static Object executeQuery(final RequestContainer requestContainer,
            final ResponseContainer responseContainer, final String pool, final SourceBean query,
            final String type) {
  logger.debug("IN");
        Object result = null;
        DataConnection dataConnection = null;

        try {
            // Open the connection
            dataConnection = openConnection(pool);
            result = executeQuery(requestContainer, responseContainer, dataConnection, query, type);
View Full Code Here

    try {     
     
      aSession = HibernateUtil.currentSession();
      tx = aSession.beginTransaction();
      Connection jdbcConnection = aSession.connection();
      DataConnection dataConnection = getDataConnection(jdbcConnection);
     
      rowsSourceBean =
        (SourceBean) DelegatedQueryExecutor.executeQuery(
          serviceRequestContext.getRequestContainer(),
          serviceRequestContext.getResponseContainer(),
View Full Code Here

    * @return the data connection
    *
    * @throws EMFInternalError the EMF internal error
    */
   public static DataConnection getDataConnection(Connection con) throws EMFInternalError {
       DataConnection dataCon = null;
       try {
           Class mapperClass = Class.forName("it.eng.spago.dbaccess.sql.mappers.OracleSQLMapper");
           SQLMapper sqlMapper = (SQLMapper)mapperClass.newInstance();
           dataCon = new DataConnection(con, "2.1", sqlMapper);
       } catch(Exception e) {
           SpagoBITracer.major(SpagoBIConstants.NAME_MODULE, DelegatedHibernateConnectionListService.class.getName() , "getDataConnection",
                   "Error while getting Spago DataConnection " + e);
           throw new EMFInternalError(EMFErrorSeverity.ERROR, "cannot build DataConnection object");
       }
View Full Code Here

     */
    public static Object executeSelect(RequestContainer requestContainer, ResponseContainer responseContainer,
      String datasource, String statement) throws EMFInternalError {
  logger.debug("IN");
  Object result = null;
  DataConnection dataConnection = null;
  SQLCommand sqlCommand = null;
  DataResult dataResult = null;
  try {
      DataSourceUtilities dsUtil = new DataSourceUtilities();
      Connection conn = dsUtil.getConnection(requestContainer,datasource);
      dataConnection = dsUtil.getDataConnection(conn);
      sqlCommand = dataConnection.createSelectCommand(statement);
      dataResult = sqlCommand.execute();
      ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult.getDataObject();
      result = scrollableDataResult.getSourceBean();
  } finally {
      Utils.releaseResources(dataConnection, sqlCommand, dataResult);
View Full Code Here

TOP

Related Classes of it.eng.spago.dbaccess.sql.DataConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.