Examples of SQLBuilder


Examples of org.eigenbase.sql.util.SqlBuilder

        String mofId,
        String libraryFileName,
        Map<String, String> wrapperOptions) throws SQLException
    {
        final String methodName = "get_plugin_property_info";
        final SqlBuilder sqlBuilder = createSqlBuilder();
        sqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(mofId)
            .append(", ")
            .literal(libraryFileName)
            .append(", ");
        toValues(sqlBuilder, wrapperOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = sqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

Examples of org.eigenbase.sql.util.SqlBuilder

        String libraryFileName,
        Map<String, String> wrapperOptions,
        Map<String, String> serverOptions)
        throws SQLException
    {
        final SqlBuilder selectSqlBuilder = createSqlBuilder();
        final String methodName = "get_server_property_info";
        selectSqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(mofId)
            .append(", ")
            .literal(libraryFileName)
            .append(", ");
        toValues(selectSqlBuilder, wrapperOptions)
            .append(", ");
        toValues(selectSqlBuilder, serverOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = selectSqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

Examples of org.eigenbase.sql.util.SqlBuilder

        RelOptCluster cluster,
        RelOptConnection connection)
    {
        String queryString = getFemView().getQueryExpression().getBody();
        if (datasetName != null) {
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            buf.append(
                ((modality == ModalityTypeEnum.MODALITYTYPE_STREAM)
                 ? "SELECT STREAM"
                 : "SELECT"))
                .append(" * FROM (")
                .append(queryString)
                .append(") AS x TABLESAMPLE SUBSTITUTE (")
                .literal(datasetName)
                .append(")");
            queryString = buf.getSql();
        }
        return expandView(queryString);
    }
View Full Code Here

Examples of org.eigenbase.sql.util.SqlBuilder

        String serverName,
        Map<String, String> tableOptions)
        throws SQLException
    {
        final String methodName = "browse_table";
        final SqlBuilder selectSqlBuilder = createSqlBuilder();
        selectSqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(serverName)
            .append(", ");
        toValues(selectSqlBuilder, tableOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = selectSqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

Examples of org.eigenbase.sql.util.SqlBuilder

        Map<String, String> tableOptions,
        Map<String, String> columnOptions)
        throws SQLException
    {
        final String methodName = "browse_column";
        final SqlBuilder selectSqlBuilder = createSqlBuilder();
        selectSqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(serverName)
            .append(", ");
        toValues(selectSqlBuilder, tableOptions)
            .append(", ");
        toValues(selectSqlBuilder, columnOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = selectSqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

Examples of org.eigenbase.sql.util.SqlBuilder

     */
    public List<ForeignSchemaInfo> browseForeignSchemas(String serverName)
        throws SQLException
    {
        final String methodName = "browse_foreign_schemas";
        final SqlBuilder selectSqlBuilder = createSqlBuilder();
        selectSqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(serverName)
            .append("))");
        final String sql = selectSqlBuilder.getSql();
        Connection connection = dataSource.getConnection();
        Statement statement = connection.createStatement();
        ResultSet resultSet = statement.executeQuery(sql);
        assert resultSet.getMetaData().getColumnCount() == 2;
        List<ForeignSchemaInfo> schemaInfo = new ArrayList<ForeignSchemaInfo>();
View Full Code Here

Examples of org.fto.jthink.jdbc.SQLBuilder

    //JDBCTransaction transaction = (JDBCTransaction)resManager.getResource(JDBCTransaction.class.getName());
    JDBCTransaction transaction = (JDBCTransaction)((TransactionFactory)resManager.getResource("SampleTransaction")).create();
    /* 返回SQLExecutor工厂,并创建SQLExecutor对象 */
    SQLExecutor sqlExecutor = transaction.getSQLExecutorFactory(connId).create();
    /* 返回SQLBuilder工厂,并创建SQLBuilder对象 */
    SQLBuilder sqlBuilder = transaction.getSQLBuilderFactory(connId).create("");

    try{
      /* 开始事务 */
      transaction.begin();
      //transaction.setAutoCommit(connId, true);
View Full Code Here

Examples of org.fto.jthink.jdbc.SQLBuilder

//    PreparedStatement ps = sqlExecutor.getConnection().prepareStatement("select 1");
//    logger.debug("timeout:"+ps.getQueryTimeout());
//    ps.close();
//    logger.debug("timeout:"+sqlExecutor.getTimeout());
    /* 返回SQLBuilder工厂,并创建SQLBuilder对象 */
    SQLBuilder sqlBuilder = transaction.getSQLBuilderFactory("SampleDataSource").create("");
   
    try{
      /* 开始事务 */
      transaction.begin();
     
      //logger.debug("getTransactionLevel():"+transaction.getTransactionLevel("SampleDataSource"));
     
      messagesHM.put("ID", generateID(sqlExecutor));
      messagesHM.put("SendTime", DateTimeHelper.formatDateTimetoString(DateTimeHelper.getSystemDate()));
     
      SQL sql = sqlBuilder.constructSQLForInsert("Messages", messagesHM);
      if(logger.isDebugEnabled()){
        logger.debug("通过SQLBuilder构建的SQL: " + sql.getSQLString()+"     "+messagesHM);
      }
      /* 执行SQ语句 */
      sqlExecutor.execute(sql);
View Full Code Here

Examples of org.fto.jthink.jdbc.SQLBuilder

    //JDBCTransaction transaction = (JDBCTransaction)resManager.getResource(JDBCTransaction.class.getName());
    JDBCTransaction transaction = (JDBCTransaction)((TransactionFactory)resManager.getResource("SampleTransaction")).create();
    /* 返回SQLExecutor工厂,并创建SQLExecutor对象 */
    SQLExecutor sqlExecutor = transaction.getSQLExecutorFactory("SampleDataSource").create();
    /* 返回SQLBuilder工厂,并创建SQLBuilder对象 */
    SQLBuilder sqlBuilder = transaction.getSQLBuilderFactory("SampleDataSource").create("");
   
    try{
      /* 开始事务 */
      transaction.begin();

      Condition condi = new Condition();
      condi.add(new ConditionItem("ID","=",id));
     
      SQL sql = sqlBuilder.constructSQLForUpdate("Messages", messagesHM, condi);
      if(logger.isDebugEnabled()){
        logger.debug("通过SQLBuilder构建的SQL: " + sql.getSQLString()+"     "+messagesHM);
      }
      /* 执行SQ语句 */
      Object rs = sqlExecutor.execute(sql);
View Full Code Here

Examples of org.fto.jthink.jdbc.SQLBuilder

    //JDBCTransaction transaction = (JDBCTransaction)resManager.getResource(JDBCTransaction.class.getName());
    JDBCTransaction transaction = (JDBCTransaction)((TransactionFactory)resManager.getResource("SampleTransaction")).create();
    /* 返回SQLExecutor工厂,并创建SQLExecutor对象 */
    SQLExecutor sqlExecutor = transaction.getSQLExecutorFactory("SampleDataSource").create();
    /* 返回SQLBuilder工厂,并创建SQLBuilder对象 */
    SQLBuilder sqlBuilder = transaction.getSQLBuilderFactory("SampleDataSource").create("");
   
    try{
      /* 开始事务 */
      transaction.begin();

      Condition condi = new Condition();
      condi.add(new ConditionItem("ID","=",id));
     
      SQL sql = sqlBuilder.constructSQLForDelete("Messages", condi);
      if(logger.isDebugEnabled()){
        logger.debug("通过SQLBuilder构建的SQL: " + sql.getSQLString()+"     ");
      }
      /* 执行SQ语句 */
      Object rs = sqlExecutor.execute(sql);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.