Examples of ISQLAlias


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

      _isExpanded = tree.isExpanded(new TreePath(dmtn.getPath()));


      if(dmtn.getUserObject() instanceof ISQLAlias)
      {
         ISQLAlias alias = (ISQLAlias) dmtn.getUserObject();
         _aliasIdentifier = alias.getIdentifier();
         _aliasName = alias.getName();
      }
      else
      {
         _folderName = dmtn.getUserObject().toString();
         _kids = new AliasFolderState[dmtn.getChildCount()];
View Full Code Here

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

   public Iterator<ISQLAlias> getAliasesForDriver(ISQLDriver driver)
   {
      ArrayList<ISQLAlias> data = new ArrayList<ISQLAlias>();
      for (Iterator<ISQLAlias> it = aliases(); it.hasNext();)
      {
         ISQLAlias alias = it.next();
         if (driver.equals(getDriver(alias.getDriverIdentifier())))
         {
            data.add(alias);
         }
      }
      return data.iterator();
View Full Code Here

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

    return (SQLAlias)getList().getSelectedValue();
  }

   public void sortAliases()
   {
      final ISQLAlias selectedAlias = getSelectedAlias(null);

      _model.sortAliases();


    SwingUtilities.invokeLater(new Runnable()
View Full Code Here

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

   */
  public AliasInternalFrame getCreateSheet()
  {
    final net.sourceforge.squirrel_sql.client.gui.db.DataCache cache = _app.getDataCache();
    final IIdentifierFactory factory = IdentifierFactory.getInstance();
    final ISQLAlias alias = cache.createAlias(factory.createIdentifier());
    final AliasInternalFrame sheet = new AliasInternalFrame(_app, alias, NEW);
    _app.getMainFrame().addWidget(sheet);
      DialogWidget.centerWithinDesktop(sheet);
    return sheet;
  }
View Full Code Here

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

      final DataCache cache = _app.getDataCache();
      synchronized (cache)
      {
         for (Iterator<ISQLAlias> it = cache.aliases(); it.hasNext();)
         {
            ISQLAlias alias = it.next();
            if (alias.isConnectAtStartup())
            {
               aliases.add(alias);
            }
         }
      }
View Full Code Here

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

      _aliasList = al;
   }

   public void actionPerformed(ActionEvent e)
   {
      ISQLAlias selectedAlias = _aliasList.getSelectedAlias(null);

      if(null == selectedAlias)
      {
         return;
      }
View Full Code Here

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

  @Test
  public void testEqualsAndHashcode() {
    IIdentifier id1 = mockHelper.createMock(IIdentifier.class);
    IIdentifier id2 = mockHelper.createMock(IIdentifier.class);
   
    ISQLAlias alias1 = mockHelper.createMock(ISQLAlias.class);
    EasyMock.expect(alias1.getIdentifier()).andStubReturn(id1);
    ISQLAlias alias2 = mockHelper.createMock(ISQLAlias.class);
    EasyMock.expect(alias2.getIdentifier()).andStubReturn(id2);
   
    mockHelper.replayAll();
   
    AliasScript a = new AliasScript(alias1);
    AliasScript b = new AliasScript(alias1);
View Full Code Here

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

         }


         for (Iterator i = _session.getApplication().getDataCache().getAliasesForDriver(cacheDriver); i.hasNext();)
         {
            ISQLAlias alias = (ISQLAlias) i.next();

            String serverName = getUrlBegin(alias.getUrl());

            if (false == curServerName.equalsIgnoreCase(serverName))
            {
               continue;
            }

            String nameSpaceOfAlias = alias.getUrl().substring(alias.getUrl().lastIndexOf('/') + 1);

            String aliasNames = (String) aliasesByNamespaces.get(nameSpaceOfAlias.toUpperCase());

            if (null != aliasNames)
            {
               if (0 == aliasNames.length())
               {
                  aliasNames += alias.getName();
               }
               else
               {
                  aliasNames += ";" + alias.getName();
               }
               aliasesByNamespaces.put(nameSpaceOfAlias, aliasNames);

            }
         }
View Full Code Here

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

   private String onNameSpaceSelected(ISession session, String nameSpace, String aliasNameTemplate)
   {

      try
      {
         ISQLAlias curAlias = session.getAlias();

         String urlPrefix = "jdbc:Cache://";

         if (false == curAlias.getUrl().startsWith(urlPrefix))
         {
            String msg = "URL of this session does not start with " + urlPrefix + ".\nCannot create alias";
            JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), msg);
            return "";
         }

         if (urlPrefix.length() >= curAlias.getUrl().lastIndexOf(':'))
         {
            String msg = "Could not find server in this session's URL " + curAlias.getUrl() + ".\nURL must match jdbc:Cache://<server>:<port>/<namespace>\n" +
               "Cannot create alias.";
            JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), msg);
            return "";
         }


         String server = curAlias.getUrl().substring(urlPrefix.length(), curAlias.getUrl().lastIndexOf(':'));

         ISQLAlias alias = session.getApplication().getDataCache().createAlias(IdentifierFactory.getInstance().createIdentifier());

         alias.setName(aliasNameTemplate.replaceAll("%server", server).replaceAll("%namespace", nameSpace));
         alias.setDriverIdentifier(curAlias.getDriverIdentifier());
         alias.setUserName(curAlias.getUserName());
         alias.setPassword(curAlias.getPassword());
         alias.setUrl(curAlias.getUrl().substring(0, curAlias.getUrl().lastIndexOf('/') + 1) + nameSpace);
         alias.setAutoLogon(curAlias.isAutoLogon());

         session.getApplication().getDataCache().addAlias(alias);

         return alias.getName();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

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

  }

  private void refreshScript()
  {
    boolean setText = false;
    ISQLAlias alias = _aliasesCmb.getSelectedSQLAlias();
    if (alias != null)
    {
      AliasScript script = _plugin.getScriptsCache().get(alias);
      String sql = script.getSQL();
      if (sql != null && sql.length() > 0)
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.