In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| import java.sql.Connection; | |
| import java.sql.SQLException; | |
| import org.apache.tomcat.jdbc.pool.DataSource; | |
| import org.apache.tomcat.jdbc.pool.PoolProperties; | |
| public class DataSourceConfig { | |
| public static final String DATA_SOURCE_CLASS_NAME = "org.postgresql.Driver"; | |
| public static final String DATA_SOURCE_URL = "jdbc:postgresql://%s:%s/%s"; | |
| public static final String JDBC_INTERCEPTORS = "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;" + "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"; |
| import java.sql.Connection; | |
| import java.sql.PreparedStatement; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| public class SampleProgram { | |
| public static void main(String[] args) throws SQLException { | |
| DataSourceConfig ds = configureConnection(); | |
| String statement = "SELECT id FROM test_tbl"; | |
| try (Connection con = ds.getConnection()) { |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| <dependency> | |
| <groupId>org.apache.tomcat</groupId> | |
| <artifactId>tomcat-jdbc</artifactId> | |
| <version>8.0.30</version> | |
| </dependency> |