rapid-framework 连接 oracle时的一个bug

在连接oracle数据库时报错:

Exception in thread "main" java.lang.RuntimeException: create table object error,tableName:BIN$Z/lzLZsvmqzgQKjAyQEZdw==$0
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.createTable(DbTableFactory.java:115)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.getAllTables(DbTableFactory.java:124)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.getAllTables(DbTableFactory.java:81)
	at cn.org.rapid_framework.generator.GeneratorFacade.printAllTableNames(GeneratorFacade.java:25)
	at cn.org.rapid_framework.generator.GeneratorMain.main(GeneratorMain.java:13)
Caused by: java.sql.SQLException: ORA-01424: missing or illegal character following the escape character

	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
	at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
	at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
	at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1198)
	at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2400)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527)
	at oracle.jdbc.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:2569)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.getColumnsResultSet(DbTableFactory.java:342)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.getTableColumns(DbTableFactory.java:294)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.retriveTableColumns(DbTableFactory.java:278)
	at cn.org.rapid_framework.generator.provider.db.DbTableFactory.createTable(DbTableFactory.java:109)
	... 4 more

 问题在于把系统表也读了出来,解决办法:

在createTable(Connection conn, ResultSet rs) 

方法里加判断

  if(realTableName.indexOf("$")>0)

return null;

 

在getAllTables方法里加

if(table != null)

tables.add(table);

你可能感兴趣的:(java,thread,oracle,sql,jdbc)