Skip to content
nimamoosavi edited this page Aug 25, 2021 · 3 revisions

This project is an application programming interface (API) for the programming language Java, which defines how a client may access a database. It is a Java-based data access technology used for Java database connectivity. It is part of the Java Standard Edition platform.

and implement in jdbc client project, but you can change it with your implementation

JDBC-Client Project

methode

List<Map<String, Object>> queryForList(String sql, MapSqlParameterSource sqlParameterSource)

sql is the native query for execute in Data Base

sqlParameterSource is the parameter source for execute parametric

return List<Map < String, Object>> of the result of dataBase

List< T > queryForList(String sql, MapSqlParameterSource sqlParameterSource, Class< T > tClass)

sql is the native query for execute in Data Base

sqlParameterSource is the parameter source for execute parametric

tClass the class you want cast it

return List< T > the object that cast it

List< T > queryForList(String sql, int queryTimeOut, Class< T > tClass)

sql is the native query for execute in Data Base

queryTimeOut is the time that you want method wait for response

tClass the class you want cast it

List< T > the object that cast it

List<Map<String, Object>> queryForList(String sql, int queryTimeOut)

sql is the native query for execute in Data Base

queryTimeOut is the time that you want method wait for response

return List<Map < String, Object>> is the result of data Base

T query(String sql, MapSqlParameterSource sqlParameterSource, Class< T > tClass)

sql is the native query for execute in Data Base

sqlParameterSource is the parameter source for execute parametric

tClass the class you want cast it

return the single result that result from data Base

you must know if the result not been single the methode throw Runtime Exception

T query(String sql, int queryTimeOut, Class< T > tClass)

sql is the native query for execute in Data Base

queryTimeOut is the time that you want method wait for response

tClass the class you want cast it

return T is the Object of result from database

Map<String, Object> query(String sql, MapSqlParameterSource sqlParameterSource)

sql is the native query for execute in Data Base

sqlParameterSource is the parameter source for execute parametric

return Map<String, Object> the result of Data base

you must know if the result not been a single result the methode throw Runtime Exception

int maxRows()

return the number of max rows in table

int queryTimeOut()

return the default Time out of Connection

int queryTimeOut(NamedParameterJdbcTemplate namedParameterJdbcTemplate)

namedParameterJdbcTemplate is the Object of Spring that you must use it for execute query

return the Object Time out of Connection

int queryTimeOut(JdbcTemplate jdbcTemplate)

jdbcTemplate is the Object of Spring that you must use it for execute query

return the Object Time out of Connection

T save(T t)

t : the Entity View Model that you must Add To Data Base

return the Optional Of Entity that save it in database

T update(I id, T t)

id : the incrementalId of dataBase Object

t: the Entity View Model that you must Add To Data Base

return the Entity that save it in dataBase

List< T > saveAll(List< T > tList)

tList : the list of Entity that you must save it in Data base

return the List Of Entity and their Ids

Optional< T > findById(I id)

id the incrementalId of dataBase Object

return the Entity that save it in dataBase

List< T > findAll()

return the List Of Entities

List< T > findAll(int page, int pageSize)

page : the page number that you must fetch it

pageSize : the page Size of that you need to split Data

List< T > findAll(int page, int pageSize, String orders)

page : the page number that you must fetch it

pageSize : the page Size of that you need to split Data

orders : is the list of fields and your direction such as Asc and Desc for Sorting

return the List Of Entity from Response Of Data Base

long count()

return the Number Of data

void deleteById(I id)

id : is the incrementalId of Object that you need to remove it from Data Base

throws RuntimeException has throw if Delete Method Not Acceptable