JDBC Driver Connection URL strings

JDBC Driver Connection URL strings
Techiio-author
Written by Sagar RabidasFebruary 22, 2022
4 min read
Hibernate
2 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWS SHARE
Techiio-author
Sagar Rabidas

Software Developer

In this blog, we will discuss JDBC Driver Connection URL strings

Introduction of JDBC:-

Java database connectivity (JDBC) is the JavaSoft specification of a trendy application programming interface (API) that permits java applications to get entry to database management structures. The JDBC API consists of a set of interfaces and classes written within the Java programming language.

With the use of those popular interfaces and training, programmers can write programs that hook up with databases, ship queries written in based question language (square), and system the consequences.

Because JDBC is a trendy specification, one java program that makes use of the JDBC API can connect with any database management gadget (DBMS), so long as a driving force exists for that particular DBMS.

Oracle:-

The JDBC connection properties look as follows:

JDBC Driver	oracle.jdbc.OracleDriver
JDBC URL	jdbc:oracle:thin:@localhost:1521:orclpdb1
Hibernate Dialect	org.hibernate.dialect.Oracle12cDialect

And, if you want to connect using a JDBC DataSource, this is what you need to use:

OracleDataSource dataSource = new OracleDataSource();
dataSource.setDatabaseName("high_performance_java_persistence");
dataSource.setURL("jdbc:oracle:thin:@localhost:1521/orclpdb1");
dataSource.setUser("oracle");
dataSource.setPassword("admin");

MySQL:-

The JDBC connection properties look as follows:

JDBC Driver	com.mysql.jdbc.Driver
JDBC URL	jdbc:mysql://localhost/high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.MySQL8Dialect

And, if you want to connect using a JDBC DataSource, this is what you need to use:

MysqlDataSource dataSource = new MysqlDataSource();
dataSource.set URL(
    "jdbc:mysql://localhost/high_performance_java_persistence"
);
dataSource.setUser("mysql");
dataSource.setPassword("admin");

PostgreSQL:-

The JDBC connection properties look as follows:

JDBC Driver	org.postgresql.Driver
JDBC URL	jdbc:postgresql://localhost/high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.PostgreSQL95Dialect

And, if you want to connect using a JDBC DataSource, this is what you need to use:

PGSimpleDataSource dataSource = new PGSimpleDataSource();
dataSource.setDatabaseName("high_performance_java_persistence");
dataSource.setServerName("localhost");
dataSource.setUser("postgres");
dataSource.setPassword("admin");

SQL Server:-

The JDBC connection properties look as follows:

JDBC Driver	com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC URL	jdbc:sqlserver://localhost;instance=SQLEXPRESS;databaseName=high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.SQLServer2012Dialect

And, if you want to connect using a JDBC DataSource, this is what you need to use:

SQLServerDataSource dataSource = new SQLServerDataSource();
dataSource.set URL(
    "jdbc:sqlserver://localhost;instance=SQLEXPRESS;" +
    "databaseName=high_performance_java_persistence;"
);
dataSource.setUser("sa");
dataSource.setPassword("adm1n");

MariaDB:-

The JDBC connection properties look as follows:

JDBC Driver	org.mariadb.jdbc.Driver
JDBC URL	jdbc:mariadb://localhost/high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.MariaDB53Dialect

Db2 Express-C:-

The JDBC connection properties look as follows:

JDBC Driver	com.ibm.db2.jcc.DB2Driver
JDBC URL	jdbc:db2://localhost/high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.DB2Dialect

SAP HANA:-

The JDBC connection properties look as follows:

JDBC Driver	com.sap.db.jdbc.Driver
JDBC URL	jdbc:sap://localhost/high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.HANAColumnStoreDialect

Informix:-

The JDBC connection properties look as follows:

JDBC Driver	com.informix.jdbc.IfxDriver
JDBC URL	jdbc:informix-sqli://localhost:9088/sysuser:INFORMIXSERVER=hpjp
Hibernate Dialect	org.hibernate.dialect.InformixDialect

HSQLDB:-

The JDBC connection properties look as follows:

JDBC Driver	org.hsqldb.jdbc.JDBCDriver
JDBC URL	jdbc:hsqldb:mem:high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.HSQLDialect

And, if you want to connect using a JDBC DataSource, this is what you need to use:

JDBCDataSource dataSource = new JDBCDataSource();
dataSource.setUrl("jdbc:hsqldb:mem:test");
dataSource.setUser("sa");
dataSource.setPassword("");

H2:-

The JDBC connection properties look as follows:

JDBC Driver	org.h2.Driver
JDBC URL	jdbc:h2:mem:high_performance_java_persistence
Hibernate Dialect	org.hibernate.dialect.H2Dialect

Derby:-

The JDBC connection properties look as follows:

JDBC Driver	org.apache.derby.jdbc.EmbeddedDriver
JDBC URL	jdbc:derby:target/tmp/derby/hpjp;databaseName=high_performance_java_persistence;create=true
Hibernate Dialect	org.hibernate.dialect.DerbyTenSevenDialect

Hibernate
JDBC
Java
JDBC Driver
Java Database
2 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-author
Sagar Rabidas
Software Developer
Techiio-followerTechiio-followerTechiio-followerTechiio-followerTechiio-follower
+9 more
300 Blog Posts
14 Discussion Threads
Trending Technologies
15
Software40
DevOps48
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance