Package net.sourceforge.squirrel_sql.client.session

Examples of net.sourceforge.squirrel_sql.client.session.ISession


  /**
     * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab#createDataSet()
     */
    @Override
    protected IDataSet createDataSet() throws DataSetException {
        final ISession session = getSession();
        try
        {
            ISQLConnection con = session.getSQLConnection();
            Statement stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(QUERY);
            ResultSetDataSet rsds = new ResultSetDataSet();
            rsds.setResultSet(rs, DialectType.POSTGRES);
            return rsds;
View Full Code Here


    super(hint);
  }

  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());
        }       
View Full Code Here

    super(i18n.TITLE, i18n.HINT, true);
  }

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

        if (s_log.isDebugEnabled()) {
            s_log.debug("Sequence details SQL: "+SQL);
            s_log.debug("Sequence schema: "+doi.getSchemaName());
            s_log.debug("Sequence name: "+doi.getSimpleName());
        }

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

    super(i18n.TITLE, i18n.HINT, true);
  }

  protected PreparedStatement createStatement() throws SQLException
  {
    ISession session = getSession();
    PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
    IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

      boolean result = true;
      String createPlanTableSQL =
          getCreatePlanTableSQL(getPlanTableName());
      Statement stmt = null;
      try {
          ISession session = getSession();
          ISQLConnection con = session.getSQLConnection();
          stmt = con.createStatement();
          stmt.execute(createPlanTableSQL);
          SchemaInfo schemaInfo = session.getSchemaInfo();
          schemaInfo.refershCacheForSimpleTableName("PLAN_TABLE");
      } catch (SQLException ex) {
          result = false;
          getSession().showErrorMessage(ex);
          s_log.error(ex);
View Full Code Here

          log.debug(msg);
        }
        continue;
      }

      ISession destSession = prov.getCopyDestSession();
      String destSchema = prov.getDestSelectedDatabaseObject().getSimpleName();
      String destCatalog = prov.getDestSelectedDatabaseObject().getCatalogName();
      if (tableHasForeignKey(destCatalog, destSchema, ti.getSimpleName(), fkInfo, prov))
      {
        if (log.isInfoEnabled())
View Full Code Here

  public static String getCreateTableSql(SessionInfoProvider prov, ITableInfo ti) throws SQLException,
        MappingException, UserCancelledOperationException
  {

    ISession sourceSession = prov.getCopySourceSession();
    String sourceSchema = prov.getSourceSelectedDatabaseObjects()[0].getSchemaName();
    String sourceCatalog = prov.getSourceSelectedDatabaseObjects()[0].getCatalogName();
    String sourceTableName = getQualifiedObjectName(
       sourceSession, sourceCatalog, sourceSchema, ti.getSimpleName(), DialectFactory.SOURCE_TYPE);
    ISession destSession = prov.getCopyDestSession();
    String destSchema = prov.getDestSelectedDatabaseObject().getSimpleName();
    String destCatalog = prov.getDestSelectedDatabaseObject().getCatalogName();
    String destinationTableName = getQualifiedObjectName(
       destSession, destCatalog, destSchema, ti.getSimpleName(), DialectFactory.DEST_TYPE);
    StringBuilder result = new StringBuilder("CREATE TABLE ");
View Full Code Here

    if (notNullable)
    {
      result.append(" NOT NULL");
    } else
    {
      ISession destSession = prov.getCopyDestSession();
      HibernateDialect d = DialectFactory.getDialect(
         DialectFactory.DEST_TYPE, destSession.getApplication().getMainFrame(), destSession.getMetaData());
      String nullString = d.getNullColumnString().toUpperCase();
      result.append(nullString);
    }
    return result.toString();
  }
View Full Code Here

        throws SQLException, UserCancelledOperationException
  {
    StringBuilder result = new StringBuilder("select ");
    result.append(columnList);
    result.append(" from ");
    ISession sourceSession = prov.getCopySourceSession();

    String tableName = getQualifiedObjectName(
       sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(),
       DialectFactory.SOURCE_TYPE);
    result.append(tableName);
View Full Code Here

  {
    StringBuilder result = new StringBuilder();
    result.append("insert into ");
    String destSchema = prov.getDestSelectedDatabaseObject().getSimpleName();
    String destCatalog = prov.getDestSelectedDatabaseObject().getCatalogName();
    ISession destSession = prov.getCopyDestSession();
    result.append(getQualifiedObjectName(
       destSession, destCatalog, destSchema, ti.getSimpleName(), DialectFactory.DEST_TYPE));
    result.append(" ( ");
    result.append(columnList);
    result.append(" ) values ( ");
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.session.ISession

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.