Examples of ISQLConnection


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 schemaName = parentDbinfo.getSchemaName();
    final String catalogName = parentDbinfo.getCatalogName();
    final IDatabaseObjectInfo tableInfo = ((TriggerParentInfo) parentDbinfo).getTableInfo();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      String tableName = tableInfo.getSimpleName();
      String query = triggerExtractor.getTableTriggerQuery();
      if (s_log.isDebugEnabled())
      {
        s_log.debug("Getting triggers for table " + tableName + " in schema " + schemaName
              + " and catalog " + catalogName + " - Running query: " + query);
      }
      pstmt = conn.prepareStatement(query);
      triggerExtractor.bindParamters(pstmt, tableInfo);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        DatabaseObjectInfo doi = new DatabaseObjectInfo(
View Full Code Here

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

    replacementMap.put(""+importedKeyNoAction, importedKeyNoAction + " (NO ACTION)");
    replacementMap.put(""+importedKeySetDefault, importedKeySetDefault + " (SET DEFAULT)");
    replacements.put(9, replacementMap);
    replacements.put(10, replacementMap);
   
    final ISQLConnection conn = getSession().getSQLConnection();
   
    IDataSet orig = getUnfilteredDataSet(conn.getSQLMetaData(), getTableInfo());
     return new FilterDataSet(orig, replacements);
  }
View Full Code Here

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

  /**
   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
    try
    {
            DatabaseMetaData md = conn.getSQLMetaData().getJDBCMetaData();
      return new MetaDataDecoratorDataSet(md, getSession().getDriver().getDriverClassName(), getSession().getDriver().getJarFileNames());
    }
    catch (SQLException ex)
    {
      throw new DataSetException(ex);
View Full Code Here

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

  /**
   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
        IDataSet result = null;
        SQLDatabaseMetaData md = conn.getSQLMetaData();
        result = md.getPrimaryKey(getTableInfo(),
                                  new int[] { 6, 5, 4 },
                                  true);
        return result;
  }
View Full Code Here

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

  protected IDataSet createDataSet() throws DataSetException
  {
    final ISession session = getSession();
    try
    {
      final ISQLConnection conn = session.getSQLConnection();
      final String[] tableTypes = conn.getSQLMetaData().getTableTypes();
      return new ObjectArrayDataSet(tableTypes);
    }
    catch (SQLException ex)
    {
      throw new DataSetException(ex);
View Full Code Here

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

    final ISession session = getSession();

    try
    {
      final ISQLConnection conn = session.getSQLConnection();
        TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo((ITableInfo)_objectInfo);
        for (int i = 0; i < infos.length; i++) {
           TableColumnInfo info = infos[i];
           columnNames.add(info.getColumnName());
        }
    }
View Full Code Here

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

  /**
   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
        SQLDatabaseMetaData md = conn.getSQLMetaData();
        return md.getColumns(getTableInfo(), columnIndices, true);
  }
View Full Code Here

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

   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISession session = getSession();
    final ISQLConnection conn = session.getSQLConnection();
    return new JavabeanDataSet(new ConnectionInfo(conn, session));
  }
View Full Code Here

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

  }

    private class SetAutoCommitTask implements Runnable {
               
        public void run() {
            final ISQLConnection conn = _session.getSQLConnection();
            final SessionProperties props = _session.getProperties();
            if (conn != null)
            {
                boolean auto = true;
                try
                {
                    auto = conn.getAutoCommit();
                }
                catch (SQLException ex)
                {
                    s_log.error("Error with transaction control", ex);
                    _session.showErrorMessage(ex);
                }
                try
                {
                    conn.setAutoCommit(props.getAutoCommit());
                }
                catch (SQLException ex)
                {
                    props.setAutoCommit(auto);
                    _session.showErrorMessage(ex);
View Full Code Here

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

      if (whereClause.length() == 0)
         // i18n[DataSetUpdateableTableModelImpl.confirmupdateallrows=The table has no columns that can be SELECTed on.\nAll rows will be updated.\nDo you wish to proceed?]
         return s_stringMgr.getString("DataSetUpdateableTableModelImpl.confirmupdateallrows");

      final ISession session = _session;
      final ISQLConnection conn = session.getSQLConnection();

      int count = -1// start with illegal number of rows matching query

      try
      {
         Statement stmt = null;
         ResultSet rs = null;
         try
         {
            stmt = conn.createStatement();
            String countSql = "select count(*) from " + ti.getQualifiedName() + whereClause;
            rs = stmt.executeQuery(countSql);
            rs.next();
            count = rs.getInt(1);
         }
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.