Skip to content

Instantly share code, notes, and snippets.

View kasramp's full-sized avatar
:octocat:
Chasing bugs

Kasra Madadipouya kasramp

:octocat:
Chasing bugs
View GitHub Profile
@kasramp
kasramp / Pom.xml
Created January 30, 2016 16:05
Maven dependency for Tomcat JDBC Connection Pool
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>8.0.30</version>
</dependency>
@kasramp
kasramp / DataSource.java
Last active July 8, 2023 21:26
JDBC connection pool class
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";
@kasramp
kasramp / SampleProgram.java
Last active July 8, 2023 21:17
JDBC connection pool test connection
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()) {
@kasramp
kasramp / git_submodules.md
Created October 27, 2019 20:03 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

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.
# 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.