本文整理汇总了Java中gudusoft.gsqlparser.TGSqlParser类的典型用法代码示例。如果您正苦于以下问题:Java TGSqlParser类的具体用法?Java TGSqlParser怎么用?Java TGSqlParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TGSqlParser类属于gudusoft.gsqlparser包,在下文中一共展示了TGSqlParser类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertSQLToXML
import gudusoft.gsqlparser.TGSqlParser; //导入依赖的package包/类
protected String convertSQLToXML( TGSqlParser sqlparser )
{
StringBuffer buffer = new StringBuffer( );
TStatementList stmts = sqlparser.getSqlstatements( );
for ( int i = 0; i < stmts.size( ); i++ )
{
direct_sql_statement directSqlStatement = new direct_sql_statement( );
convertStmtToModel( stmts.get( i ),
directSqlStatement.getDirectly_executable_statement( ) );
try
{
Serializer serializer = new Persister( new Format( "<?xml version=\"1.0\" encoding= \"UTF-8\" ?>" ) );
StringWriter sw = new StringWriter( );
serializer.write( directSqlStatement, sw );
sw.close( );
buffer.append( sw.toString( ) );
}
catch ( Exception e )
{
e.printStackTrace( );
}
}
return buffer.toString( );
}
示例2: parseSelString
import gudusoft.gsqlparser.TGSqlParser; //导入依赖的package包/类
public static Stmt parseSelString(String text) throws NoSqlTypeException {
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvteradata);
sqlparser.sqltext = text;
int ret = sqlparser.parse();
if (ret == 0) {
return analyzeStmt(sqlparser.sqlstatements.get(0));
} else {
throw new NoSqlTypeException();
}
}
示例3: parse
import gudusoft.gsqlparser.TGSqlParser; //导入依赖的package包/类
@Override
public void parse(String statements) throws DBAppException {
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvmysql);
sqlparser.sqltext = statements;
int ret = sqlparser.parse();
if (ret != 0)
throw new SyntaxErrorException(sqlparser.getErrormessage());
for (int i = 0; i < sqlparser.sqlstatements.size(); i++) {
try {
shell.write(analyzeStmt(sqlparser.sqlstatements.get(i)));
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例4: generateXML
import gudusoft.gsqlparser.TGSqlParser; //导入依赖的package包/类
public String generateXML( EDbVendor vendor, String sql )
{
errorMessage = null;
TGSqlParser sqlparser = new TGSqlParser( vendor );
sqlparser.sqltext = sql;
int resultCode = sqlparser.parse( );
if ( resultCode != 0 )
{
errorMessage = sqlparser.getErrormessage( );
return null;
}
else
return convertSQLToXML( sqlparser );
}