com.home.ln_spring.ch8.dao.jdbc.annotation.SfFirstNameById.java Source code

Java tutorial

Introduction

Here is the source code for com.home.ln_spring.ch8.dao.jdbc.annotation.SfFirstNameById.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.home.ln_spring.ch8.dao.jdbc.annotation;

import java.sql.Types;
import javax.sql.DataSource;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.SqlFunction;

/**
 *
 * @author vitaliy
 */
public class SfFirstNameById extends SqlFunction<String> {

    private static final String SQL = "select getfirstnamebyid(?)";

    public SfFirstNameById(DataSource dataSource) {
        super(dataSource, SQL);
        declareParameter(new SqlParameter(Types.INTEGER));
        compile();
    }
}