Great job. Thanks I liked making complex sql. Take dto.class for Entity And without using RowMapping you can immediately get the result complex sql query. A very effective thing for developing reporting forms and developing microservices.
Basant - any good references to learn DSA and system design for 10 years experience. Most of the companies shortlist candidates based on that. Please suggest 🙏
can you please share any reference as once i called query with limit 1000 it is taking more than 15 sec but need it below 10 seconds from spring boot application @@Javatechie
Do you know if this is sql injection safe? Thank you in advance!!!! In another hand. How can be implemented a filter via query param? I have always problems with this :( thank you a lot
Could you show an example of a search on a partial name or title using the LIKE operator with JdbcClient? I have been having some trouble getting that to work. I have done this many times successfully with myBatis or JPA. Here is a similar code snippet that I was trying but not sure what I have wrong. I was testing it by just passing lowercase a or e, but not getting any results trying to use .params() method. It does work if I append partialLastNameLike to the query instead of using parameters, but that is not ideal. @Override public List findByPartialLastName(String partialLastName) { String partialLastNameLike = "'%" + partialLastName.toLowerCase() + "%'"; return jdbcClient.sql("select * from author where lower(last_name) like :partialLastNameLike") .param("partialLastNameLike",partialLastNameLike, Types.VARCHAR) .query(Author.class) .list(); } }
throw new IllegalArgumentException("Invalid positional parameter value of type Iterable (" + value.getClass().getSimpleName() + "): Parameter expansion is only supported with named parameters."); getting this exception if use jdbcClient.sql("INSERT INTO book(id, name, title) VALUES (?,?,?)") .param(List.of(book.getId(), book.getName(), book.getTitle())) .update(); working with: jdbcClient.sql("INSERT INTO book(id, name, title) VALUES (:id,:name,:title)") .param("id", book.getId()) .param("name", book.getName()) .param("title", book.getTitle()) .update();
Great job. Thanks
I liked making complex sql.
Take dto.class for Entity
And without using RowMapping you can immediately get the result complex sql query.
A very effective thing for developing reporting forms and developing microservices.
Finally not so different from "mybatis framework"
Thanks for a video! Nice an example!
Thank you very much for sharing wonderful content
Thanks, Basant, for your efforts. God bless you. 🙏🙂
In spring data JPA we have @Query annotation. In this we can set native true if we want.
Then what is difference between @Query and this new feature?
Superb bro... new thing i have learnt... thank you...
Thank you.
Could you please explain debugging concepts pls
Waiting for next video of microservices design pattern
Basant - any good references to learn DSA and system design for 10 years experience. Most of the companies shortlist candidates based on that. Please suggest 🙏
Thanks for your great tutorial, But why these sql query, what if you want to do a complex query, can't it be mapped to data JPA queries
Can you please cover course on Filter, interceptor ,requestbodyAdvise ,responsebodyAdvide. Thanks .😊
How to mock or do junit for JdbcClient
Also please advise in context to NO SQL flavors like mongo it can be used
Thanks for vídeo, how to do when it's can populate object inside object? for example, client.address.street
I need your help regarding configuration of multiple database in spring boot please
Already I have uploaded how to configure multiple datasource please check that video
it is taking almost 18 seconds to fetch 1000 records is there any alternate for that.
This is just a demo buddy implement some executor service and validate
can you please share any reference as once i called query with limit 1000 it is taking more than 15 sec but need it below 10 seconds from spring boot application @@Javatechie
Sure i will share some references but before that what database are you using?
@@Javatechie oracle database,and queried using springboot application using jdbc client
Do you know if this is sql injection safe? Thank you in advance!!!!
In another hand. How can be implemented a filter via query param? I have always problems with this :( thank you a lot
This is not sql injection safe.
Facing issue, any ide how to do it?
does this mean jdbcTemplate is now deprecated ?
No absolutely not . This api is built on top of it
Second comment ❤
First comment
Second comment
tenth comment@@RishiRajxtrim
Eleventh comment@@sijovinsamalraj3893
It’s a unnecessary repeated feature though
Could you show an example of a search on a partial name or title using the LIKE operator with JdbcClient? I have been having some trouble getting that to work. I have done this many times successfully with myBatis or JPA.
Here is a similar code snippet that I was trying but not sure what I have wrong. I was testing it by just passing lowercase a or e, but not getting any results trying to use .params() method. It does work if I append partialLastNameLike to the query instead of using parameters, but that is not ideal.
@Override
public List findByPartialLastName(String partialLastName) {
String partialLastNameLike = "'%" + partialLastName.toLowerCase() + "%'";
return jdbcClient.sql("select * from author where lower(last_name) like :partialLastNameLike")
.param("partialLastNameLike",partialLastNameLike, Types.VARCHAR)
.query(Author.class)
.list();
}
}
throw new IllegalArgumentException("Invalid positional parameter value of type Iterable (" + value.getClass().getSimpleName() + "): Parameter expansion is only supported with named parameters.");
getting this exception if use
jdbcClient.sql("INSERT INTO book(id, name, title) VALUES (?,?,?)")
.param(List.of(book.getId(), book.getName(), book.getTitle()))
.update();
working with:
jdbcClient.sql("INSERT INTO book(id, name, title) VALUES (:id,:name,:title)")
.param("id", book.getId())
.param("name", book.getName())
.param("title", book.getTitle())
.update();
List of will work please check import statement also copy paste my piece of code and check
You have used .param() instead of .params()
it should be .params(List.of(book.getId(), book.getName(), book.getTitle()))
Hope this helps