The difference between solving javax.activation.DataSource and javax.sql.DataSource

when writing a simple boot Mini Program today, the automatic injection class was written as javax.activation.DataSource, for a long time.
I suddenly find myself a stranger to this area. Can anyone explain the difference?

Mar.04,2021

look at the code and find that the interfaces defined in javax.activation.DataSource are all related to iMago. In fact, most of the existing classes are also related to network and file Imax O. It can be judged that javax.activation.DataSource is an abstraction of resource files, such as Reader, Writer, and so on. javax.sql.DataSource is a specification in the JDBC2.0 standard, which aims at the shortcomings of large consumption and non-reuse of database links obtained through DriverManager.getConnection () in the 1.0standard. javax.sql.DataSource there are only two interface methods: the getConnection () method with and without parameters. The specific implementations include DruidDataSource (Ali) and BasicDataSource (apache). These data sources can provide reusable database links, most of which are implemented by connection pooling. The advantage is that resources can be taken

.
Menu