⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ij.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        haveConnection();        int scrollType = JDBC20Translation.TYPE_FORWARD_ONLY;        Token s;        Token scrolling = null;        Token withtoken = null;        int holdType = utilInstance.getHoldability(theConnection);        String c;        Statement st = null;        String sVal;        ResultSet rs = null;        SQLWarning warns;    jj_consume_token(GET);    if (jj_2_75(2)) {      scrolling = jj_consume_token(SCROLL);      scrollType = scrollType();    } else {      ;    }    if (jj_2_76(2)) {      withtoken = jj_consume_token(WITH);      holdType = holdType();    } else {      ;    }    jj_consume_token(CURSOR);    c = identifier();    jj_consume_token(AS);    s = jj_consume_token(STRING);                sVal = stringValue(s.image);                try {                        st = utilInstance.createStatement(theConnection, scrollType, holdType);                        JDBCDisplayUtil.checkNotNull(st,"cursor");                        st.setCursorName(c);                        rs = st.executeQuery(sVal);                        JDBCDisplayUtil.checkNotNull(rs,"cursor");                        Session sn = currentConnEnv.getSession();                        sn.addCursorStatement(c,st);                        sn.addCursor(c,rs);                } catch (SQLException e) {                        if (rs!=null) rs.close();                        if (st!=null) st.close();                        {if (true) throw e;}                }                // all we want callers to see are the warnings.                SQLWarning w1 = theConnection.getWarnings();                SQLWarning w2 = st.getWarnings();                SQLWarning w3 = rs.getWarnings();                theConnection.clearWarnings();                st.clearWarnings();                rs.clearWarnings();                warns = appendWarnings(w1,w2);                {if (true) return new ijWarningResult(appendWarnings(warns,w3));}    throw new Error("Missing return statement in function");  }  final public int scrollType() throws ParseException, SQLException {    if (jj_2_77(2)) {      jj_consume_token(INSENSITIVE);                {if (true) return JDBC20Translation.TYPE_SCROLL_INSENSITIVE;}    } else if (jj_2_78(2)) {      jj_consume_token(SENSITIVE);                {if (true) return JDBC20Translation.TYPE_SCROLL_SENSITIVE;}    } else {      jj_consume_token(-1);      throw new ParseException();    }    throw new Error("Missing return statement in function");  }  final public int holdType() throws ParseException, SQLException {    if (jj_2_79(2)) {      jj_consume_token(HOLD);                {if (true) return JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;}    } else if (jj_2_80(2)) {      jj_consume_token(NOHOLD);                {if (true) return JDBC30Translation.CLOSE_CURSORS_AT_COMMIT;}    } else {      jj_consume_token(-1);      throw new ParseException();    }    throw new Error("Missing return statement in function");  }  final public ijResult AbsoluteStatement() throws ParseException, SQLException {        int row;        String c;        ResultSet rs;    jj_consume_token(ABSOLUTE);    row = intLiteral();    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.absolute(rs, row);}    throw new Error("Missing return statement in function");  }  final public ijResult RelativeStatement() throws ParseException, SQLException {        int row;        String c;        ResultSet rs;    jj_consume_token(RELATIVE);    row = intLiteral();    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.relative(rs, row);}    throw new Error("Missing return statement in function");  }  final public ijResult BeforeFirstStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(BEFORE);    jj_consume_token(FIRST);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.beforeFirst(rs);}    throw new Error("Missing return statement in function");  }  final public ijResult FirstStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(FIRST);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.first(rs);}    throw new Error("Missing return statement in function");  }  final public ijResult NextStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(NEXT);    c = identifier();                haveConnection();                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return new ijRowResult(rs, rs.next());}    throw new Error("Missing return statement in function");  }  final public ijResult AfterLastStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(AFTER);    jj_consume_token(LAST);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.afterLast(rs);}    throw new Error("Missing return statement in function");  }  final public ijResult LastStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(LAST);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.last(rs);}    throw new Error("Missing return statement in function");  }  final public ijResult PreviousStatement() throws ParseException, SQLException {        String c;        ResultSet rs;    jj_consume_token(PREVIOUS);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                {if (true) return utilInstance.previous(rs);}    throw new Error("Missing return statement in function");  }  final public ijResult GetCurrentRowNumber() throws ParseException, SQLException {        ResultSet rs;        String c;    jj_consume_token(GETCURRENTROWNUMBER);    c = identifier();                haveConnection();                // Verify that we have JDBC 2.0                Session s = currentConnEnv.getSession();                rs = (ResultSet) s.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");        LocalizedResource.OutputWriter().println(utilInstance.getCurrentRowNumber(rs));                {if (true) return null;}    throw new Error("Missing return statement in function");  }  final public ijResult CloseStatement() throws ParseException, SQLException {        String c;        ResultSet rs;        Statement s;    jj_consume_token(CLOSE);    c = identifier();                haveConnection();                Session sn = currentConnEnv.getSession();                rs = (ResultSet) sn.getCursor(c);                JDBCDisplayUtil.checkNotNull(rs,"cursor");                s = (Statement) sn.getCursorStatement(c);                JDBCDisplayUtil.checkNotNull(s,"cursor");                rs.close();                s.close();                sn.removeCursor(c);                sn.removeCursorStatement(c);                {if (true) return null;}    throw new Error("Missing return statement in function");  }/** * Hack to get the grammar to leave a * EXECUTE STATEMENT <stmt> alone.  Short * circuit the ij EXECUTE built in. */  final public ijResult JBMSPreparedStatementExec() throws ParseException, SQLException {        Token s = null;    jj_consume_token(EXECUTE);    jj_consume_token(STATEMENT);    s = jj_consume_token(STRING);                {if (true) return executeImmediate(stringValue(s.image));}    throw new Error("Missing return statement in function");  }/** * Hack to get the grammar to leave a * EXECUTE PROCEDURE <procSpec> alone.  Short * circuit the ij EXECUTE built in so that * we can deploy ij against Foundation2000. */  final public ijResult F2KExecuteProcedure() throws ParseException, SQLException {        Token s = null;    jj_consume_token(EXECUTE);    jj_consume_token(PROCEDURE);    s = jj_consume_token(STRING);                haveConnection();                Statement       aStatement = theConnection.createStatement();                String          text = "execute procedure " + s;                aStatement.execute( text );                {if (true) return new ijStatementResult( aStatement,true );}    throw new Error("Missing return statement in function");  }/** * Two forms of execute: immediate, with a string * and prepared, with the id of a prepared statement. * We expect the latter form will * eventually support a USING clause to supply * parameter values (that will be constants). * No parameters yet, however. * <p> * Syntax: *   EXECUTE statementSource [ USING statementSource] ; * *	 statementSource is an identifier of a previously prepared statement *	 or a string containing SQL-J text. */  final public ijResult ExecuteStatement() throws ParseException, SQLException {        String i = null;        Token s = null;        PreparedStatement ps;        String sVal = null;        String iUsing = null;        Token sUsing = null;        Token   usingObject = null;    jj_consume_token(EXECUTE);    if (jj_2_81(2)) {      i = identifier();    } else if (jj_2_82(2)) {      s = jj_consume_token(STRING);    } else {      jj_consume_token(-1);      throw new ParseException();    }    if (jj_2_85(2)) {      jj_consume_token(USING);      if (jj_2_83(2)) {        iUsing = identifier();      } else if (jj_2_84(2)) {        sUsing = jj_consume_token(STRING);      } else {        jj_consume_token(-1);        throw new ParseException();      }    } else {      ;    }            if (iUsing!=null || sUsing!=null) { // parameters in use                        String sUsingVal = null;                        PreparedStatement psUsing;                        SQLWarning warns = null;                        haveConnection();                        /*				Steps:				1. find or prepare the statement				2. execute the using statement				3. push the row of the using statement into the parameters				4. execute the statement against those parameters				5. clear the parameters			 */                        /*				get the prepared statement			 */                        boolean closeWhenDone = false; // will we close the ps when done?                if (i!=null) {                                ps = (PreparedStatement) currentConnEnv.getSession().getPreparedStatement(i);                                JDBCDisplayUtil.checkNotNull(ps,"prepared statement "+i);                }                else { // (s!=null)                                sVal = stringValue(s.image);                                ps = theConnection.prepareStatement(sVal);                                closeWhenDone = true;                                JDBCDisplayUtil.checkNotNull(ps,"prepared statement");                                warns = appendWarnings(warns, ps.getWarnings());                                ps.clearWarnings();                }                        /*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -