Package jodd.db

Examples of jodd.db.DbSqlException


        sqlTemplateField = wrappedPreparedStatement.getField(fieldName);

        String methodName = ProxettaAsmUtil.adviceMethodName("getQueryString", 0);
        getQueryStringMethod = wrappedPreparedStatement.getMethod(methodName);
      } catch (Exception ex) {
        throw new DbSqlException(ex);
      }
    }

    // wrap prepared statement instance

    PreparedStatement wrapper;
    try {
      wrapper = wrappedPreparedStatement.newInstance();
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }

    builder.injectTargetIntoWrapper(preparedStatement, wrapper);

    try {
      sqlTemplateField.set(wrapper, sql);
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }

    return wrapper;
  }
View Full Code Here


   */
  public static String getQueryString(PreparedStatement preparedStatement) {
    try {
      return (String) getQueryStringMethod.invoke(preparedStatement);
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }
  }
View Full Code Here

            sqlTemplateField = wrappedPreparedStatement.getField(fieldName);

            String methodName = ProxettaAsmUtil.adviceMethodName("getQueryString", 0);
            getQueryStringMethod = wrappedPreparedStatement.getMethod(methodName);
          } catch (Exception ex) {
            throw new DbSqlException(ex);
          }
        }
      }
      finally {
        lock.unlock();
      }
    }

    // wrap prepared statement instance

    PreparedStatement wrapper;
    try {
      wrapper = wrappedPreparedStatement.newInstance();
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }

    builder.injectTargetIntoWrapper(preparedStatement, wrapper);

    try {
      sqlTemplateField.set(wrapper, sql);
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }

    return wrapper;
  }
View Full Code Here

   */
  public static String getQueryString(PreparedStatement preparedStatement) {
    try {
      return (String) getQueryStringMethod.invoke(preparedStatement);
    } catch (Exception ex) {
      throw new DbSqlException(ex);
    }
  }
View Full Code Here

    String s = rs.getString(index);
    if (s == null) {
      return null;
    }
    if (s.length() > 1) {
      throw new DbSqlException("Char column size too long, should be 1");
    }
    return Character.valueOf(s.charAt(0));
  }
View Full Code Here

    SqlType sqlType = sqlTypes.get(sqlTypeClass);
    if (sqlType == null) {
      try {
        sqlType = sqlTypeClass.newInstance();
      } catch (Exception ex) {
        throw new DbSqlException("SQL type not found: " + sqlTypeClass.getSimpleName(), ex);
      }
      sqlTypes.put(sqlTypeClass, sqlType);
    }
    return sqlType;
  }
View Full Code Here

  public void init() {
    try {
      Class.forName(driverClass);
    } catch (ClassNotFoundException cnfex) {
      throw new DbSqlException("JDBC driver not found: " + driverClass, cnfex);
    }
  }
View Full Code Here

      if (autoCommit != null) {
        conn.setAutoCommit(autoCommit.booleanValue());
      }
    }
    catch (SQLException sex) {
      throw new DbSqlException("Connection not found", sex);
    }
    return conn;
  }
View Full Code Here

      } else {
        xaConnection = xaDataSource.getXAConnection();
      }
      return xaConnection.getConnection();
    } catch (SQLException sex) {
      throw new DbSqlException("Unable to get connection from XA datasource", sex);
    }
  }
View Full Code Here

  public Connection getConnection() {
    PooledConnection pconn;
    try {
      pconn = cpds.getPooledConnection();
    } catch (SQLException sex) {
      throw new DbSqlException("Invalid pooled connection", sex);
    }
    try {
      return pconn.getConnection();
    } catch (SQLException sex) {
      throw new DbSqlException("Invalid pooled connection", sex);
    }
  }
View Full Code Here

TOP

Related Classes of jodd.db.DbSqlException

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.