im using
java to build a project and im at beginner level in java so i encountered a problem
i am using gsql parser's java api to parse database queries and there is one little point where i have stuck up
there are 2 classes TSelectSqlStatement & TCreateTableSqlStatement both inherit TCustomSqlStatement class and i have to use a method in Createtable in SelectSql and when i do this type casting isnt allowed
is there any way to solve this problem??
link for the api reference is
http://www.sqlparser.com/kb/javadoc/
this is the DBSystem.java
this is the printSelect.java
This is the error when compiled
Exception in
thread "main" java.lang.ClassCastException: gudusoft.gsqlparser.stmt.TSelectSqlStatement cannot be cast to gudusoft.gsqlparser.stmt.TCreateTableSqlStatement at dbs.printSelect.analyze(printSelect.java:43) at dbs.printSelect.main(printSelect.java:34) at dbs.DBSystem.analyzeSelectStmt(DBSystem.java:758) at dbs.DBSystem.analyzeStmt(DBSystem.java:364) at dbs.DBSystem.main(DBSystem.java:347)