Examples of ISQLConnection


Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

  protected PreparedStatement createStatement() throws SQLException
  {
    final ISession session = getSession();
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();

    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

            // i18n[CreateTableOfCurrentSQLCommand.noQuery=No query found to create the script from.]
            _session.showErrorMessage(s_stringMgr.getString("CreateTableOfCurrentSQLCommand.noQuery"));
            return;
         }

         ISQLConnection conn = _session.getSQLConnection();
         Statement stmt = null;
         try
         {
            StringBuffer sbCreate = new StringBuffer();
            StringBuffer sbInsert = new StringBuffer();
            StringBuffer sbDrop = new StringBuffer();
            String statSep = ScriptUtil.getStatementSeparator(_session);



            stmt = conn.createStatement();
            stmt.setMaxRows(1);
            String sql = qt.nextQuery();
            ResultSet srcResult = stmt.executeQuery(sql);

            if(isAborted())
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

   * @return
   * @throws Exception
   */
  public static ResultSet executeQuery(ISession session, String sql) throws SQLException
  {
    ISQLConnection sqlcon = session.getSQLConnection();
    if (sqlcon == null || sql == null) { return null; }
    Statement stmt = null;
    ResultSet rs = null;

    Connection con = sqlcon.getConnection();
    try
    {
      stmt = con.createStatement();
    }
    catch (SQLException e)
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

  }

  public static ITableInfo getTableInfo(ISession session, String schema, String tableName)
    throws SQLException, MappingException, UserCancelledOperationException
  {
    ISQLConnection con = session.getSQLConnection();
    SchemaInfo schemaInfo = session.getSchemaInfo();
    // Currently, as of milestone 3, Axion doesn't support "schemas" like
    // other databases. So, set the schema to emtpy string if we detect
    // an Axion session.
    if (con.getSQLMetaData().getDriverName().toLowerCase().startsWith("axion"))
    {
      schema = "";
    }
    String catalog = null;
    // MySQL uses catalogs and not schemas
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

     * @see net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter#format(java.lang.Throwable)
     */
    public String format(Throwable t) throws Exception {
        StringBuilder msg = new StringBuilder();
        msg.append(defaultFormatter.format(t));
        ISQLConnection sqlcon = _session.getSQLConnection();
        if (sqlcon != null && sqlcon.getConnection() != null) {
            String offset = getSqlErrorOffset();
            msg.append("\n");
            msg.append(i18n.positionLabel);
            msg.append(offset);
            if (!i18n.NOT_AVAILABLE_MSG.equals(offset)) {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

     * @return a string describing the offset of the error in the current SQL.
     */
    private String getSqlErrorOffset() {
        String result = i18n.NOT_AVAILABLE_MSG;
        try {
            ISQLConnection sqlcon = _session.getSQLConnection();
            Class<?> conClass = sqlcon.getConnection().getClass();
            Connection ifmxcon = sqlcon.getConnection();

            Method getSQLStatementOffsetMethod =
                conClass.getMethod("getSQLStatementOffset", (Class[])null);
            Object offset =
                getSQLStatementOffsetMethod.invoke(ifmxcon, (Object[])null);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

        if (s_log.isDebugEnabled()) {
            s_log.debug("Running SQL: "+SQL);
            s_log.debug("trigname="+doi.getSimpleName());
        }
    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

  protected PreparedStatement createStatement() throws SQLException
  {
    final ISession session = getSession();
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();

    ISQLConnection conn = session.getSQLConnection();
        if (s_log.isDebugEnabled()) {
            s_log.debug("Running View Source SQL: "+SQL);
            s_log.debug("View Name="+doi.getSimpleName());
            s_log.debug("Schema Name="+doi.getSchemaName());
        }               
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

    if (s_log.isDebugEnabled()) {
            s_log.debug("Running SQL: "+SQL);
            s_log.debug("procname="+doi.getSimpleName());
        }

    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection

  public List<ObjectTreeNode> createChildren(ISession session, ObjectTreeNode parentNode)
        throws SQLException
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final String catalogName = parentDbinfo.getCatalogName();
    final String schemaName = parentDbinfo.getSchemaName();
    final ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      pstmt = conn.prepareStatement(SQL);
      pstmt.setString(1, schemaName);
      pstmt.setString(2, filterMatcher.getSqlLikeMatchString());
      rs = pstmt.executeQuery();
      while (rs.next())
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.