本文整理汇总了Java中com.alibaba.druid.sql.ast.expr.SQLLiteralExpr类的典型用法代码示例。如果您正苦于以下问题:Java SQLLiteralExpr类的具体用法?Java SQLLiteralExpr怎么用?Java SQLLiteralExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLLiteralExpr类属于com.alibaba.druid.sql.ast.expr包,在下文中一共展示了SQLLiteralExpr类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildResultSet
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
private RouteResultset buildResultSet(Map<String, LoadData> routeMap)
{
statement.setLocal(true);//强制local
SQLLiteralExpr fn = new SQLCharExpr(fileName); //默认druid会过滤掉路径的分隔符,所以这里重新设置下
statement.setFileName(fn);
String srcStatement = statement.toString();
RouteResultset rrs = new RouteResultset(srcStatement, ServerParse.LOAD_DATA_INFILE_SQL);
rrs.setLoadData(true);
rrs.setStatement(srcStatement);
rrs.setAutocommit(serverConnection.isAutocommit());
rrs.setFinishedRoute(true);
int size = routeMap.size();
RouteResultsetNode[] routeResultsetNodes = new RouteResultsetNode[size];
int index = 0;
for (String dn : routeMap.keySet())
{
RouteResultsetNode rrNode = new RouteResultsetNode(dn, ServerParse.LOAD_DATA_INFILE_SQL, srcStatement);
rrNode.setSource(rrs);
rrNode.setTotalNodeSize(size);
rrNode.setStatement(srcStatement);
LoadData newLoadData = new LoadData();
ObjectUtil.copyProperties(loadData, newLoadData);
newLoadData.setLocal(true);
LoadData loadData1 = routeMap.get(dn);
// if (isHasStoreToFile)
if (loadData1.getFileName()!=null)//此处判断是否有保存分库load的临时文件dn1.txt/dn2.txt,不是判断是否有clientTemp.txt
{
newLoadData.setFileName(loadData1.getFileName());
} else
{
newLoadData.setData(loadData1.getData());
}
rrNode.setLoadData(newLoadData);
routeResultsetNodes[index] = rrNode;
index++;
}
rrs.setNodes(routeResultsetNodes);
return rrs;
}
开发者ID:huang-up,项目名称:mycat-src-1.6.1-RELEASE,代码行数:41,代码来源:ServerLoadDataInfileHandler.java
示例2: buildResultSet
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
private RouteResultset buildResultSet(Map<String, LoadData> routeMap) {
statement.setLocal(true);
SQLLiteralExpr fn = new SQLCharExpr(fileName); //druid will filter path, reset it now
statement.setFileName(fn);
//replace IGNORE X LINES in SQL to avoid IGNORING X LINE in every node.
String srcStatement = this.ignoreLinesDelete(statement.toString());
RouteResultset rrs = new RouteResultset(srcStatement, ServerParse.LOAD_DATA_INFILE_SQL);
rrs.setLoadData(true);
rrs.setStatement(srcStatement);
rrs.setFinishedRoute(true);
int size = routeMap.size();
RouteResultsetNode[] routeResultsetNodes = new RouteResultsetNode[size];
int index = 0;
for (Map.Entry<String, LoadData> entry : routeMap.entrySet()) {
RouteResultsetNode rrNode = new RouteResultsetNode(entry.getKey(), ServerParse.LOAD_DATA_INFILE_SQL, srcStatement);
rrNode.setStatement(srcStatement);
LoadData newLoadData = new LoadData();
ObjectUtil.copyProperties(loadData, newLoadData);
newLoadData.setLocal(true);
LoadData loadData1 = entry.getValue();
if (loadData1.getFileName() != null) {
newLoadData.setFileName(loadData1.getFileName());
} else {
newLoadData.setData(loadData1.getData());
}
rrNode.setLoadData(newLoadData);
routeResultsetNodes[index] = rrNode;
index++;
}
rrs.setNodes(routeResultsetNodes);
return rrs;
}
开发者ID:actiontech,项目名称:dble,代码行数:34,代码来源:ServerLoadDataInfileHandler.java
示例3: getComment
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getComment() {
return comment;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLCreateViewStatement.java
示例4: setComment
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setComment(SQLLiteralExpr comment) {
if (comment != null) {
comment.setParent(this);
}
this.comment = comment;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:7,代码来源:SQLCreateViewStatement.java
示例5: parseInto
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
protected void parseInto(SQLSelectQueryBlock queryBlock) {
if (lexer.token() == (Token.INTO)) {
lexer.nextToken();
if (lexer.identifierEquals("OUTFILE")) {
lexer.nextToken();
MySqlOutFileExpr outFile = new MySqlOutFileExpr();
outFile.setFile(expr());
queryBlock.setInto(outFile);
if (lexer.identifierEquals("FIELDS") || lexer.identifierEquals("COLUMNS")) {
lexer.nextToken();
if (lexer.identifierEquals("TERMINATED")) {
lexer.nextToken();
accept(Token.BY);
}
outFile.setColumnsTerminatedBy((SQLLiteralExpr) expr());
if (lexer.identifierEquals("OPTIONALLY")) {
lexer.nextToken();
outFile.setColumnsEnclosedOptionally(true);
}
if (lexer.identifierEquals("ENCLOSED")) {
lexer.nextToken();
accept(Token.BY);
outFile.setColumnsEnclosedBy((SQLLiteralExpr) expr());
}
if (lexer.identifierEquals("ESCAPED")) {
lexer.nextToken();
accept(Token.BY);
outFile.setColumnsEscaped((SQLLiteralExpr) expr());
}
}
if (lexer.identifierEquals("LINES")) {
lexer.nextToken();
if (lexer.identifierEquals("STARTING")) {
lexer.nextToken();
accept(Token.BY);
outFile.setLinesStartingBy((SQLLiteralExpr) expr());
} else {
lexer.identifierEquals("TERMINATED");
lexer.nextToken();
accept(Token.BY);
outFile.setLinesTerminatedBy((SQLLiteralExpr) expr());
}
}
} else {
queryBlock.setInto(this.exprParser.name());
}
}
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:59,代码来源:MySqlSelectIntoParser.java
示例6: getFileName
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getFileName() {
return fileName;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadXmlStatement.java
示例7: setFileName
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setFileName(SQLLiteralExpr fileName) {
this.fileName = fileName;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadXmlStatement.java
示例8: getColumnsTerminatedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getColumnsTerminatedBy() {
return columnsTerminatedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例9: setColumnsTerminatedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setColumnsTerminatedBy(SQLLiteralExpr columnsTerminatedBy) {
this.columnsTerminatedBy = columnsTerminatedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例10: getColumnsEnclosedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getColumnsEnclosedBy() {
return columnsEnclosedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例11: setColumnsEnclosedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setColumnsEnclosedBy(SQLLiteralExpr columnsEnclosedBy) {
this.columnsEnclosedBy = columnsEnclosedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例12: getColumnsEscaped
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getColumnsEscaped() {
return columnsEscaped;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例13: setColumnsEscaped
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setColumnsEscaped(SQLLiteralExpr columnsEscaped) {
this.columnsEscaped = columnsEscaped;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例14: getLinesStartingBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getLinesStartingBy() {
return linesStartingBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例15: setLinesStartingBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setLinesStartingBy(SQLLiteralExpr linesStartingBy) {
this.linesStartingBy = linesStartingBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例16: getLinesTerminatedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public SQLLiteralExpr getLinesTerminatedBy() {
return linesTerminatedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例17: setLinesTerminatedBy
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
public void setLinesTerminatedBy(SQLLiteralExpr linesTerminatedBy) {
this.linesTerminatedBy = linesTerminatedBy;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlLoadDataInFileStatement.java
示例18: parseInto
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr; //导入依赖的package包/类
protected void parseInto(SQLSelectQueryBlock queryBlock) {
if (lexer.token() == (Token.INTO)) {
lexer.nextToken();
if (identifierEquals("OUTFILE")) {
lexer.nextToken();
MySqlOutFileExpr outFile = new MySqlOutFileExpr();
outFile.setFile(expr());
queryBlock.setInto(outFile);
if (identifierEquals("FIELDS") || identifierEquals("COLUMNS")) {
lexer.nextToken();
if (identifierEquals("TERMINATED")) {
lexer.nextToken();
accept(Token.BY);
}
outFile.setColumnsTerminatedBy((SQLLiteralExpr) expr());
if (identifierEquals("OPTIONALLY")) {
lexer.nextToken();
outFile.setColumnsEnclosedOptionally(true);
}
if (identifierEquals("ENCLOSED")) {
lexer.nextToken();
accept(Token.BY);
outFile.setColumnsEnclosedBy((SQLLiteralExpr) expr());
}
if (identifierEquals("ESCAPED")) {
lexer.nextToken();
accept(Token.BY);
outFile.setColumnsEscaped((SQLLiteralExpr) expr());
}
}
if (identifierEquals("LINES")) {
lexer.nextToken();
if (identifierEquals("STARTING")) {
lexer.nextToken();
accept(Token.BY);
outFile.setLinesStartingBy((SQLLiteralExpr) expr());
} else {
identifierEquals("TERMINATED");
lexer.nextToken();
accept(Token.BY);
outFile.setLinesTerminatedBy((SQLLiteralExpr) expr());
}
}
} else {
queryBlock.setInto(this.exprParser.name());
}
}
}
开发者ID:mazhou,项目名称:es-sql,代码行数:59,代码来源:ElasticSqlSelectParser.java
注:本文中的com.alibaba.druid.sql.ast.expr.SQLLiteralExpr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论