Package net.sourceforge.squirrel_sql.fw.sql

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 ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final String schemaName = parentDbinfo.getSchemaName();

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      pstmt = conn.prepareStatement(SQL);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        // There is a reason that we don't want to use DatabaseObjectType.SESSION here.  The "session"
        // nodes that this expander is creating should not be confused with the SQuirreL session.  These
View Full Code Here


  public String[] getColumnNames()
  {
    String[] columnNames = null;
    try
    {
      final ISQLConnection conn = _session.getSQLConnection();
      Statement stmt = conn.createStatement();
      ResultSet rs =
        stmt.executeQuery("SELECT * FROM " + getTableInfo() + ";");
      ResultSetMetaData md = rs.getMetaData();
      columnNames = new String[md.getColumnCount()];
      for (int i = 0; i < columnNames.length; i++)
View Full Code Here

  {
    String[] dataTypes = null;

    try
    {
      final ISQLConnection conn = _session.getSQLConnection();
      Statement stmt = conn.createStatement();
      ResultSet rs =
        stmt.executeQuery("SELECT * FROM " + getTableInfo() + ";");
      ResultSetMetaData md = rs.getMetaData();

      dataTypes = new String[md.getColumnCount()];
View Full Code Here

  public void execute(String SQLQuery)
  {
    try
    {

      ISQLConnection conn = _session.getSQLConnection();
      Statement stmt = conn.createStatement();
      stmt.execute(SQLQuery);
    }
    catch (SQLException ex)
    {
      _session.showErrorMessage(ex);
View Full Code Here

  {

    Vector<String> dataTypes = new Vector<String>();
    try
    {
      final ISQLConnection conn = _session.getSQLConnection();
      SQLDatabaseMetaData dmd = conn.getSQLMetaData();
      DataTypeInfo[] infos = dmd.getDataTypes();
            for (int i = 0; i < infos.length; i++) {
                dataTypes.add(infos[i].getSimpleName());
            }
    }
View Full Code Here

  {

    String primaryKey = "";
    try
    {
      ISQLConnection con = _session.getSQLConnection();
      SQLDatabaseMetaData db = con.getSQLMetaData();
            PrimaryKeyInfo[] infos = db.getPrimaryKey(getTableInfo());
            for (int i=0; i < infos.length; i++) {
                primaryKey = infos[i].getColumnName();
            }
    }
View Full Code Here

  }

  private void btCreateTableActionPerformed(java.awt.event.ActionEvent evt)
  {
    ISQLConnection con = _session.getSQLConnection();
    String query = getQuery();
    Statement stmt = null;
    try
    {
      stmt = con.createStatement();
      stmt.execute(query);
      _session.getSessionInternalFrame().getObjectTreeAPI().refreshTree();
      jd.setVisible(false);
      jd.dispose();
      JOptionPane.showMessageDialog(null,
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 IDatabaseObjectInfo tableInfo = ((TriggerParentInfo)parentDbinfo).getTableInfo();
    final PreparedStatement pstmt = conn.prepareStatement(SQL);
    try
    {
      pstmt.setString(1, tableInfo.getSchemaName());
      pstmt.setString(2, tableInfo.getSimpleName());
      ResultSet rs = pstmt.executeQuery();
View Full Code Here

    {
      s_log.debug("Running SQL: " + SQL);
      s_log.debug("Trigger Name=" + doi.getSimpleName());
      s_log.debug("Schema Name=" + doi.getSchemaName());
    }
    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName());
    pstmt.setString(2, doi.getSchemaName());
    return pstmt;
  }
View Full Code Here

    throws SQLException
  {
    _dataTypesByTypeName = new HashMap<String, DataTypeInfo>();
    _mediator = new ControlMediator();

    final ISQLConnection conn = session.getSQLConnection();

    _columnsCmb = new ColumnsComboBox(conn, ti);

    _dataTypesCmb = new DataTypesComboBox(conn);
    for (int i = 0, limit = _dataTypesCmb.getItemCount(); i < limit; ++i)
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.