Package net.sourceforge.squirrel_sql.fw.sql

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


  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();

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      pstmt = conn.prepareStatement(SQL);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        IDatabaseObjectInfo si = new DatabaseObjectInfo(
           catalogName, schemaName, rs.getString(1), DatabaseObjectType.DATATYPE, md);
View Full Code Here


  }

  private IndexInfo createIndexInfo() throws DataSetException
  {
    final ISession session = getSession();
    final ISQLConnection conn = session.getSQLConnection();

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
      pstmt = conn.prepareStatement(SQL);
      pstmt.setString(1, doi.getSimpleName());
      rs = pstmt.executeQuery();
      if (rs.next())
      {
        return new IndexInfo(
View Full Code Here

    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    if (s_log.isDebugEnabled()) {
      s_log.debug("Preparing trigger SQL statement: "+SQL);
      s_log.debug("trigger name = "+doi.getSimpleName());
    }
    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

    public List<ObjectTreeNode> createChildren(ISession session,
                                               ObjectTreeNode parentNode)
        throws SQLException
    {
        final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
        final ISQLConnection conn = session.getSQLConnection();
        final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();

        PreparedStatement pstmt = null;
       

        try
        {
            pstmt = conn.prepareStatement(ALL_INDICES_SQL);
            final ResultSet rs = pstmt.executeQuery();
            while (rs.next())
            {
                IDatabaseObjectInfo doi = new DatabaseObjectInfo(null, null,
                                            rs.getString(1),
View Full Code Here

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

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

     * Performs the table copy operation.
     */
    private void _execute() {
        start = System.currentTimeMillis();
        boolean encounteredException = false;
        ISQLConnection destConn = destSession.getSQLConnection();
        if (!analyzeTables()) {
            return;
        }
        setupAutoCommit(destConn);
        IDatabaseObjectInfo[] sourceObjs = prov.getSourceSelectedDatabaseObjects();
View Full Code Here

            return;
        }
        if (!PreferencesManager.getPreferences().isCopyData()) {
            return;
        }
        ISQLConnection sourceConn = prov.getCopySourceSession().getSQLConnection();
        ISQLConnection destConn = prov.getCopyDestSession().getSQLConnection();
        SQLDatabaseMetaData sourceMetaData = sourceConn.getSQLMetaData();
        SQLDatabaseMetaData destMetaData = destConn.getSQLMetaData();
        try {
            String destSchema =
                prov.getDestSelectedDatabaseObject().getSimpleName();           
            ITableInfo destTableInfo =
                DBUtil.getTableInfo(prov.getCopyDestSession(),
                                    destSchema,
                                    sourceTableInfo.getSimpleName());
           
            TableColumnInfo[] sourceInfos = sourceMetaData.getColumnInfo(sourceTableInfo);
            TableColumnInfo[] destInfos = destMetaData.getColumnInfo(destTableInfo);
           
            destInfos = sort(sourceInfos,
                             destInfos,
                             sourceTableInfo.getQualifiedName(),
                             destTableInfo.getQualifiedName());
           
            String sourceColList = DBUtil.getColumnList(sourceInfos);
            String destColList = DBUtil.getColumnList(destInfos);
           
            String selectSQL = DBUtil.getSelectQuery(prov,
                                                     sourceColList,
                                                     sourceTableInfo);
            String insertSQL = DBUtil.getInsertSQL(prov, destColList,
                                                   sourceTableInfo,
                                                   destInfos.length);
            insertStmt = destConn.prepareStatement(insertSQL);
           
            int count = 1;
            int commitCount = prefs.getCommitCount();
            int columnCount = destInfos.length;
            String[] bindVarVals = new String[columnCount];
View Full Code Here

    {
        if (!prefs.isCopyForeignKeys()
            || DialectFactory.isAxion(prov.getCopySourceSession().getMetaData())) {
            return;
        }
        ISQLConnection destConn = prov.getCopyDestSession().getSQLConnection();
        for (int i = 0; i < dbObjs.length; i++) {
            ITableInfo ti = (ITableInfo) dbObjs[i];
            Set<String> fkStmts =
                DBUtil.getForeignKeySQL(prov, ti, selectedTableInfos);
            Iterator<String> it = fkStmts.iterator();
View Full Code Here

        throws SQLException, UserCancelledOperationException, MappingException
    {
        if (cancelled) {
            return;
        }
        ISQLConnection destCon = prov.getCopyDestSession().getSQLConnection();
        String createTableSql = DBUtil.getCreateTableSql(prov, ti);
        DBUtil.executeUpdate(destCon, createTableSql, true);
       
        if (prefs.isCommitAfterTableDefs() && !currentAutoCommitValue) {
            commitConnection(destCon);
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection$IPropertyNames

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.