Package net.sourceforge.squirrel_sql.fw.sql

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


    @Override
    protected IDataSet createDataSet() throws DataSetException {
        final ISession session = getSession();
        try
        {
            ISQLConnection con = session.getSQLConnection();
            Statement stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(QUERY);
            ResultSetDataSet rsds = new ResultSetDataSet();
            rsds.setResultSet(rs, DialectType.POSTGRES);
            return rsds;
        }
View Full Code Here


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

    ISQLConnection conn = session.getSQLConnection();
        if (s_log.isDebugEnabled()) {
            s_log.debug("Running View Source SQL: "+SQL);
            s_log.debug("View Name="+doi.getSimpleName());
            s_log.debug("Schema Name="+doi.getSchemaName());
        }       
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSimpleName()); // view name
        pstmt.setString(2, doi.getSchemaName()); // schema name
    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();
      ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());


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

        return result;
    }
   
    private int getErrorPosition(String sql) throws SQLException {
        int result = -1;
        ISQLConnection sqlcon = _session.getSQLConnection();
        Connection con = sqlcon.getConnection();
        CallableStatement cstmt = null;

        try {
            String callSql = "{?=call "+OFFSET_FUNCTION_NAME+"(?)}";
            if (s_log.isDebugEnabled()) {
View Full Code Here

        }
        return result;
    }
   
    private boolean initOffsetFunction() throws SQLException {
        ISQLConnection sqlcon = _session.getSQLConnection();
        Connection con = sqlcon.getConnection();
        CallableStatement cstmt = null;
        Statement stmt = null;
        boolean result = true;
        try {
            stmt = con.createStatement();
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 = ((ConstraintParentInfo)parentDbinfo).getTableInfo();
    final String schemaName = parentDbinfo.getSchemaName();
    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

      String createPlanTableSQL =
          getCreatePlanTableSQL(getPlanTableName());
      Statement stmt = null;
      try {
          ISession session = getSession();
          ISQLConnection con = session.getSQLConnection();
          stmt = con.createStatement();
          stmt.execute(createPlanTableSQL);
          SchemaInfo schemaInfo = session.getSchemaInfo();
          schemaInfo.refershCacheForSimpleTableName("PLAN_TABLE");
      } catch (SQLException ex) {
          result = false;
View Full Code Here

  private boolean getAlternatePlanTable(String planTableName) {
      PreparedStatement pstmt = null;
      ResultSet rs = null;
      ArrayList<String> planTableList = new ArrayList<String>();
      try {
          ISQLConnection con = _session.getSQLConnection();
          pstmt = con.prepareStatement(ALL_PLAN_TABLE_SQL);
          pstmt.setString(1, planTableName);
          rs = pstmt.executeQuery();
          while (rs.next()) {
              String owner = rs.getString(1);
              String tableName = rs.getString(2);
View Full Code Here

  private boolean userPlanTableExists() {
      boolean result = false;
      PreparedStatement stmt = null;
      ResultSet rs = null;
      try {
          ISQLConnection con = getSession().getSQLConnection();
          stmt = con.prepareStatement(USER_PLAN_TABLE_SQL);
          stmt.setString(1, getPlanTableName());
          rs = stmt.executeQuery();
          if (rs.next()) {
              result = true;
          }
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();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final String schemaName = parentDbinfo.getSchemaName();

    final PreparedStatement pstmt = conn.prepareStatement(isAdmin?SQL_ADMIN:SQL_USER);
    try
    {
      ResultSet rs = pstmt.executeQuery();
      try
      {
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.