Java REST using DataSource

I am new to Java REST, and I would like to create โ€œsimpleโ€ REST services that query the database and return some JSON information.

I would like to use JDBC DB access, without JPA.

When working with servlets, I configure the server data source, and in my servlets in the "init ()" method I store a link to the data source and each request creates a connection.

What should I do for REST services?

Thanks in advance.

+4
source share
1 answer

If you plan to connect via JDBC based on REST API requests and are already familiar with REST, you should consider supporting Spring JDBC: Current Spring JDBC support . This will take care of all your problems regarding the right place and time to create / search for a data source or connection.

+4
source

All Articles