Package net.sourceforge.squirrel_sql.fw.sql

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


   public String createSelectScriptString(IDatabaseObjectInfo[] dbObjs)
   {
      StringBuffer sbScript = new StringBuffer(1000);
      StringBuffer sbConstraints = new StringBuffer(1000);
      ISQLConnection conn = _session.getSQLConnection();
      try
      {
        boolean isJdbcOdbc = conn.getSQLMetaData().getURL().startsWith("jdbc:odbc:");
        if (isJdbcOdbc)
        {
           // TODO I18N
           _session.showErrorMessage("JDBC-ODBC Bridge doesn't provide necessary meta data. Script will be incomplete");
        }

        for (int k = 0; k < dbObjs.length; k++)
        {
           if (false == dbObjs[k] instanceof ITableInfo)
           {
              continue;
           }
           ITableInfo ti = (ITableInfo) dbObjs[k];

           sbScript.append("SELECT ");

           TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo(ti);
           for (int i = 0; i < infos.length; i++)
           {
              if(0 < i)
              {
                 sbScript.append(',');
View Full Code Here


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

    ISQLConnection conn = session.getSQLConnection();
    String sql = MQT_SQL;
    if (isOS400)
    {
      sql = OS400_MQT_SQL;
    }
    boolean isMQT = isMQT();
    if (!isMQT)
    {
      sql = getTableSelectSql((ITableInfo) doi);

      // we may have more than one statement in sql at this point
      super.appendSeparator = false;
    } else
    {
      // MQTs only ever have one sql statement
      super.appendSeparator = true;
    }
    if (s_log.isDebugEnabled())
    {
      s_log.debug("Running SQL for table source tab: " + sql);
      s_log.debug("schema=" + doi.getSchemaName());
      s_log.debug("view name=" + doi.getSimpleName());
    }
    PreparedStatement pstmt = conn.prepareStatement(sql);
    if (isMQT)
    {
      pstmt.setString(1, doi.getSchemaName());
      pstmt.setString(2, doi.getSimpleName());
    }
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;
    ResultSet rs = null;
    try
    {
      pstmt = conn.prepareStatement(SQL);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        IDatabaseObjectInfo doi = new DatabaseObjectInfo(
           null, null, rs.getString(1), IObjectTypes.INSTANCE, md);
View Full Code Here

  private List<ObjectTreeNode> createNodes(ISession session, String catalogName,
                      String schemaName)
    throws SQLException
  {
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = conn.getSQLMetaData();
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
      ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());

      // Add node for each object.
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    try
   
      pstmt.setString(1, _objectType._objectTypeColumnData);
      pstmt.setString(2, schemaName);
      pstmt.setString(3, filterMatcher.getSqlLikeMatchString());
View Full Code Here

      final StringBuffer sbRows = new StringBuffer(1000);
      _session.getApplication().getThreadPool().addTask(new Runnable()
      {
         public void run()
         {
            ISQLConnection conn = _session.getSQLConnection();
            try
            {
               final Statement stmt = conn.createStatement();
               try
               {
                  //IObjectTreeAPI api = _session.getObjectTreeAPI(_plugin);
                  IObjectTreeAPI api = FrameWorkAcessor.getObjectTreeAPI(_session, _plugin);
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, ObjectSourceTab.this._columnData);
    pstmt.setString(2, doi.getSchemaName());
    pstmt.setString(3, 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 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());

        String sql = SQL;
        if (isOS400) {
            sql = OS_400_SQL;
        }

    final PreparedStatement pstmt = conn.prepareStatement(sql);
        ResultSet rs = null;
    try
    {
      pstmt.setString(1, schemaName);
      pstmt.setString(2, filterMatcher.getSqlLikeMatchString());
View Full Code Here

    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 = conn.prepareStatement(SQL);
        try {
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                IDatabaseObjectInfo si = new DatabaseObjectInfo(catalogName,
                        schemaName, rs.getString(1),
View Full Code Here

        if (s_log.isDebugEnabled()) {
            s_log.debug("Running SQL: "+SQL);
            s_log.debug("schema="+doi.getSchemaName());
            s_log.debug("trigname="+doi.getSimpleName());
        }
    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

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


      String sql = SQL;
    if (isOS400) {
        sql = OS_400_SQL;
    }
    final PreparedStatement pstmt = conn.prepareStatement(sql);
        ResultSet rs = null;
    try
    {
      pstmt.setString(1, schemaName);
      pstmt.setString(2, filterMatcher.getSqlLikeMatchString());
View Full Code Here

TOP

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

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.