Example usage for org.springframework.jdbc.core SqlParameter SqlParameter

List of usage examples for org.springframework.jdbc.core SqlParameter SqlParameter

Introduction

In this page you can find the example usage for org.springframework.jdbc.core SqlParameter SqlParameter.

Prototype

public SqlParameter(String name, int sqlType, int scale) 

Source Link

Document

Create a new SqlParameter, supplying name and SQL type.

Usage

From source file:org.codehaus.grepo.procedure.compile.ProcedureCompilationUtils.java

/**
 * @param in The annotation./*  www .  j  a va2 s. co  m*/
 * @param context The procedure execution context.
 * @return Returns the created descriptor.
 */
public static ProcedureParamDescriptor createParamDescriptor(In in, ProcedureExecutionContext context) {
    SqlParameter sp = null;
    if (in.scale() >= 0) {
        sp = new SqlParameter(in.name(), in.sqlType(), in.scale());
    } else if (StringUtils.isNotEmpty(in.typeName())) {
        sp = new SqlParameter(in.name(), in.sqlType(), in.typeName());
    } else {
        sp = new SqlParameter(in.name(), in.sqlType());
    }

    return new ProcedureParamDescriptor(sp.getName(), ProcedureParamType.IN, sp, in.index());
}