主题:pageQuery报错

cctv2258@vip.qq.com 2019年06月30日 110

今天用了pageQuery做查询,发现Oracle不能使用,用mysql没问题

Oracle

1.png

2.png

mysql 

5.png

6.png

闲大赋 2019年07月01日

关于oracle,能否把错误提示完整贴出来
还有,用的beetlsql哪个版本?

如果你想用Oracle,得设置OracleStyle,你确认做了这个吗?

cctv2258@vip.qq.com 2019年07月01日

版本号1.2.3

public class BeetlSqlTest {
    static String driver = OracleDriver.class.getName();
    static String url = "jdbc:oracle:thin:@localhost:1521:orcl";
    static String username = "test";
    static String password = "123456";

    static String driver2 = Driver.class.getName();
    static String url2 = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&useInformationSchema=true";
    static String username2 = "root";
    static String password2 = "123456";


    public static void main(String[] args) {
//        ConnectionSource source = ConnectionSourceHelper.getSimple(driver, url, username, password);
        ConnectionSource source = ConnectionSourceHelper.getSimple(driver2, url2, username2, password2);
        DBStyle style = new MySqlStyle();
//        DBStyle style = new OracleStyle();
        SQLLoader loader = new ClasspathLoader("/sql");
        UnderlinedNameConversion nc = new UnderlinedNameConversion();
        SQLManager sqlManager = new SQLManager(style, loader, source, nc, new Interceptor[]{new DebugInterceptor()});
        PageQuery query = new PageQuery();
        sqlManager.pageQuery("user.queryUser", User.class, query);
        System.out.println(JSON.toJSON(query));

    }
}
闲大赋 2019年07月03日

错误提示呢?

cctv2258@vip.qq.com 2019年07月03日

Exception in thread "main" java.lang.RuntimeException: 标签未正确结束:_pageEnd,碰到非法符号'#' at org.beetl.core.text.HTMLTagContentParser.endTag(HTMLTagContentParser.java:326) at org.beetl.core.text.HTMLTagContentParser.parserStart(HTMLTagContentParser.java:117) at org.beetl.core.text.HTMLTagContentParser.parser(HTMLTagContentParser.java:97) at org.beetl.core.text.HtmlTagStartFragment.consumeAndReturnNext(HtmlTagStartFragment.java:118) at org.beetl.core.text.TextParser.scan1(TextParser.java:101) at org.beetl.core.text.TextParser.doParse(TextParser.java:61) at org.beetl.core.GroupTemplate.loadTemplate(GroupTemplate.java:570) at org.beetl.core.GroupTemplate.getTemplateByLoader(GroupTemplate.java:526) at org.beetl.core.GroupTemplate.getTemplate(GroupTemplate.java:503) at org.beetl.sql.core.SQLScript.run(SQLScript.java:76) at org.beetl.sql.core.SQLScript.run(SQLScript.java:66) at org.beetl.sql.core.SQLScript.select(SQLScript.java:327) at org.beetl.sql.core.SQLScript.select(SQLScript.java:439) at org.beetl.sql.core.SQLManager.select(SQLManager.java:568) at org.beetl.sql.core.SQLManager.pageQuery(SQLManager.java:645) at org.beetl.sql.core.SQLManager.pageQuery(SQLManager.java:572) at com.BeetlSqlTest.main(BeetlSqlTest.java:36)

闲大赋 2019年07月03日

好的,我看看