All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.jdbc.query.params.JdbcPrm Maven / Gradle / Ivy

There is a newer version: 2.3.6
Show newest version
package tech.ydb.jdbc.query.params;


import java.sql.SQLException;
import java.util.Collections;
import java.util.List;

import tech.ydb.jdbc.common.TypeDescription;
import tech.ydb.table.query.Params;

/**
 *
 * @author Aleksandr Gorshenin
 */
public interface JdbcPrm {
    String getName();
    TypeDescription getType();

    void setValue(Object obj, int sqlType) throws SQLException;
    void copyToParams(Params params) throws SQLException;

    void reset();

    interface Factory {
        List create();
    }

    static Factory simplePrm(String name) {
        return () -> Collections.singletonList(new SimpleJdbcPrm(name));
    }

    static Factory uint64Prm(String name) {
        return () -> Collections.singletonList(new UInt64JdbcPrm(name));
    }

    static Factory inListOrm(String name, int count) {
        return () -> new InListJdbcPrm(name, count).toJdbcPrmList();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy