mysql连接字符串 jdbc_JDBC连接数据库连接字符串

周宏伯
2023-12-01

1. 数据库 2.java程序 import java.io.Serializable; import java.util.Date; //实体Bean:Enity JavaBean //Java类型和数据库类型:对应关系。相对固定的 public class User implements Serializable { private int id; private String name; private String

# Database user password

database.password=${database.password}

# Database URL (this parameter is specific to your database type)

# Examples:

#

Firebird:

#

jdbc:firebirdsql:127.0.0.1/3050:/firebird/db.gdb

#

MS SQL:

#

jdbc:jtds:sqlserver://127.0.0.1:1433/dealerportal;charset=Cp1251

#

MySQL:

#

jdbc:mysql://127.0.0.1/db?autoReconnect=true&sessionVariables=sql_mode='PIPES_AS_CONCAT'

#

Oracle:

#

jdbc:oracle:thin:@127.0.0.1:1521:db

#

PostgreSQL:

#

jdbc:postgresql://127.0.0.1:5432/db?charSet=KOI8

#

Sybase:

#

jdbc:sybase:Tds:127.0.0.1:2048?CHARSET=cp1251

database.url=${database.url}

# Database driver class (this parameter is specific to your database driver)

# Examples:

#

Firebird:

#

org.firebirdsql.jdbc.FBDriver

#

MS SQL:

#

net.sourceforge.jtds.jdbc.Driver

#

MySQL:

#

org.gjt.mm.mysql.Driver

#

Oracle:

#

oracle.jdbc.OracleDriver

#

PostgreSQL:

#

org.postgresql.Driver

#

Sybase:

#

com.sybase.jdbc2.jdbc.SybDriver

database.driver=${database.driver}

# Database dialect (use appropriate Hibernate dialect class from or#使用JDBC操作数据库

#1、JDBC基础

#JDBC简介:JDBC(Java Database Connectivity)是一种可以执行SQL的Java API,通过它可以用一种API操作不同的数据库.

#JDBC驱动:不同数据库间,标准的SQL语句可以移植,而数据库实际通信协议及某些数据库特征不可移g.hibernate.dialect package)

# Examples:

#

Firebird:

#

#

MS SQL:

#

org.hibernate.dialect.SQLServerDialect

- MSSQL Server

#

MySQL:

#

org.hibernate.dialect.MySQLDialect

- Generic MySQL

#

org.hibernate.dialect.MySQLInnoDBDialect

- MySQL InnoDB

#

org.hibernate.dialect.MySQLMyISAMDialect

- MySQL MyISA

#

Oracle:

#

org.hibernate.dialect.Oracle9Dialect

- Oracle 9

#

org.hibernate.dialect.OracleDialect

- Generic Oracle (prior to 9)

#

PostgreSQL:

#

org.hibernate.dialect.PostgreSQLDialect

#

Sybase:

#

org.hibernate.dialect.Sybase11Dialect

- Sybase 11

#

org.hibernate.dialect.SybaseAnywhereDialect

- Sybase Anywhere

#

org.hibernate.dialect.SybaseDialect

- Generic Sybase

database.dialect=${database.dialect}

# Show SQL queries (true/false)

database.show_sql=${database.show_sql}

# Minimum database connections pool size

database.pool.min_size=${database.pool.min_size}

# Maximum database connections pool size. Too small value may affect application performance

database.pool.max_size=${database.pool.max_size}

 类似资料: