Examples of Sql


Examples of com.conexao.SQL

            t.begin();


            MusicaGerencia.mapearDiretorio(new File("D:/Users/manchini/Music/Minhas músicas/"), t,null,0);

            SQL sql = new SQL();
            sql.add("SELECT * from musica");
            ResultSet rs = t.executeQuery(sql.getSql());
            while(rs.next()){
                System.out.println(rs.getString("id"));
                System.out.println(rs.getString("nome"));
                System.out.println(rs.getString("caminho"));
                System.out.println(rs.getString("img"));
View Full Code Here

Examples of com.consol.citrus.model.testcase.core.Sql

        return action;
    }

    @Override
    public Sql convertModel(ExecuteSQLAction definition) {
        Sql action = new ObjectFactory().createSql();

        action.setDescription(definition.getDescription());
        action.setDatasource(definition.getDataSource().toString());

        return action;
    }
View Full Code Here

Examples of com.ibatis.sqlmap.engine.mapping.sql.Sql

    errorContext.setResource(this.getResource());

    try {
      parameterObject = validateParameter(parameterObject);

      Sql sql = getSql();

      errorContext.setMoreInfo("Check the parameter map.");
      ParameterMap parameterMap = sql.getParameterMap(request, parameterObject);

      errorContext.setMoreInfo("Check the result map.");
      ResultMap resultMap = sql.getResultMap(request, parameterObject);

      request.setResultMap(resultMap);
      request.setParameterMap(parameterMap);

      errorContext.setMoreInfo("Check the parameter map.");
      Object[] parameters = parameterMap.getParameterObjectValues(request, parameterObject);

      errorContext.setMoreInfo("Check the SQL statement.");
      String sqlString = sql.getSql(request, parameterObject);

      errorContext.setActivity("executing mapped statement");
      errorContext.setMoreInfo("Check the SQL statement or the result map.");
      RowHandlerCallback callback = new RowHandlerCallback(resultMap, resultObject, rowHandler);
      sqlExecuteQuery(request, conn, sqlString, parameters, skipResults, maxResults, callback);

      errorContext.setMoreInfo("Check the output parameters.");
      if (parameterObject != null) {
        postProcessParameterObject(request, parameterObject, parameters);
      }

      errorContext.reset();
      sql.cleanup(request);
      notifyListeners();
    } catch (SQLException e) {
      errorContext.setCause(e);
      throw new NestedSQLException(errorContext.toString(), e.getSQLState(), e.getErrorCode(), e);
    } catch (Exception e) {
View Full Code Here

Examples of groovy.sql.Sql

    this.ds = ds;
  }

  @Override
  public Sql get() {
    return new Sql(ds);
  }
View Full Code Here

Examples of liquibase.sql.Sql

        List<Sql> commands = new ArrayList<Sql>(Arrays.asList(super.generateSql(statement, database, sqlGeneratorChain)));
        // for postgres, we need to also set the sequence to be owned by this table for true serial like functionality.
        // this will allow a drop table cascade to remove the sequence as well.
        SequenceNextValueFunction sequenceFunction = (SequenceNextValueFunction) statement.getDefaultValue();

        Sql alterSequenceOwner = new UnparsedSql("ALTER SEQUENCE " + database.escapeSequenceName(statement.getCatalogName(),
                statement.getSchemaName(), sequenceFunction.getValue()) + " OWNED BY " +
                database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName()) + "."
                + database.escapeObjectName(statement.getColumnName(), Column.class),
                getAffectedColumn(statement),
                getAffectedSequence(sequenceFunction));
View Full Code Here

Examples of mondrian.olap.MondrianDef.SQL

      RolapStarForTests rs = getStar("sales");
      MondrianDef.Table original = new MondrianDef.Table();
      original.name = "TestTable";
      original.alias = "Alias";
      original.schema = "Sechema";
      original.filter = new SQL();
      original.filter.dialect = "generic";
      original.filter.cdata = "Alias.clicked = 'true'";

      MondrianDef.Table cloned = (MondrianDef.Table)rs.cloneRelationForTests(
          original,
View Full Code Here

Examples of net.paoding.rose.jade.annotation.SQL

    private SQLType sqlType;

    public SQLType getSQLType() {
        if (sqlType == null) {
            SQL sql = method.getAnnotation(SQL.class);
            SQLType sqlType = sql.type();
            if (sqlType == SQLType.AUTO_DETECT) {
                for (int i = 0; i < SELECT_PATTERNS.length; i++) {
                    // 用正则表达式匹配  SELECT 语句
                    if (SELECT_PATTERNS[i].matcher(getSQL()).find()) {
                        sqlType = SQLType.READ;
View Full Code Here

Examples of org.apache.beehive.controls.system.jdbc.JdbcControl.SQL

        final Class returnType = m.getReturnType();
        final boolean isArray = returnType.isArray();

        try {
            if (isArray) {
                final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
                return arrayFromResultSet(resultSet, methodSQL.arrayMaxLength(), returnType, cal);
            } else {

                if (!resultSet.next()) {
                    return _tmf.fixNull(m.getReturnType());
                }
View Full Code Here

Examples of org.apache.ibatis.jdbc.SQL

import org.apache.ibatis.jdbc.SQL;

public class BoundBlogSql {

  public String selectBlogsSql() {
    return new SQL() {
      {
        SELECT("*");
        FROM("BLOG");
      }
    }.toString();
View Full Code Here

Examples of org.exolab.castor.mapping.xml.Sql

        if (identity == null) {
            throw new DTXException("no identity field in class: " + clsMapping.getName());
        }

        Sql identitySQLElement = identity.getSql();

        if (identitySQLElement == null) {
            throw new DTXException("no identity SQL info in class: " + clsMapping.getName());
        }

        String identitySQL = identitySQLElement.getName()[0];

        _ids.add(table + "." + identitySQL);

        DTXClassDescriptor desc = new DTXClassDescriptor(clsMapping);

        _classes.put(table + "." + identitySQL, desc);

        // If this class extends another class, create a join with the parent table and
        // add the load fields of the parent class (but not the store fields)
        if (clsMapping.getExtends() != null) {

        /**
          * TODO : Needs to be resolved by Hand
          */

            MapTo extendsTo = new MapTo()//(ClassMapping) clsMapping.getExtends()).getMapTo();
            if (extendsTo == null) {
                throw new DTXException("no mapping info for extends table.");
            }
            String extendsTable = extendsTo.getTable();
            expr.addInnerJoin(table, identitySQL, extendsTable, identitySQL);
            /**
             * needs to be resolved by hand
             */
            initQuery(new ClassMapping(), expr);
            //(ClassMapping) clsMapping.getExtends(), expr);
        }

        for (int i = 0; i < fields.length; ++i) {
            FieldMapping field = fields[i];
            Sql fieldSql = field.getSql();
            ClassMapping relMapping = _eng.getClassMapping(field.getType());

            if (fieldSql == null) {
                if (relMapping != null) {

                    // We have a one-to-many relationship with a sub object.
                    // get those objects, too.

                    FieldMapping[] relFields = relMapping.getClassChoice().getFieldMapping();
                    MapTo relMapTo = relMapping.getMapTo();

                    if (relMapTo == null) {
                        throw new DTXException("dtx.NoRelatedMapTo");
                    }

                    String relTable = relMapTo.getTable();

                    String foreKey = null;

                    for (int k = 0; k < relFields.length; k++) {
                        Sql relSql = relFields[k].getSql();
                        if (relSql != null) {
                            String type = relFields[k].getType();
                            if (type != null && type.equals(clsMapping.getName())) {
                                foreKey = relSql.getName()[0];
                            }
                        }
                    }

                    if (foreKey != null) {
                        expr.addOuterJoin(table, identitySQL, relTable, foreKey);
                        DTXClassDescriptor relDesc = new DTXClassDescriptor(relMapping);

                        for (int n = 0; n < relFields.length; n++) {
                            FieldMapping relField = relFields[n];
                            Sql relSql = relFields[n].getSql();
                            if (relSql != null) {
                                String relFieldName = relSql.getName()[0];
                                if (relFieldName == null) {
                                    relFieldName = relFields[n].getName();
                                }
                                String relFullName = relTable + "." + relFieldName;

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.