Database connection URL address Daquan

2010-10-08  来源:本站原创  分类:Database  人气:218 

The following lists the various databases using the JDBC connection, it can be used as a guide.

1, Oracle8/8i/9i database (thin model)

Class.forName ("oracle.jdbc.driver.OracleDriver"). NewInstance ();
String url = "jdbc: oracle: thin: @ localhost: 1521: orcl";
/ / Orcl SID for the database
String user = "test";
String password = "test";
Connection conn = DriverManager.getConnection (url, user, password);

2, DB2 database

Class.forName ("com.ibm.db2.jdbc.app.DB2Driver"). NewInstance ();
String url = "jdbc: db2: / / localhost: 5000/sample";
/ / Sample for your database name
String user = "admin";
String password = "";
Connection conn = DriverManager.getConnection (url, user, password);

3, Sql Server7.0/2000 database

Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver"). NewInstance ();
String url = "jdbc: microsoft: sqlserver: / / localhost: 1433; DatabaseName = mydb";
/ / Mydb database
String user = "sa";
String password = "";
Connection conn = DriverManager.getConnection (url, user, password);

4, Sybase Database

Class.forName ("com.sybase.jdbc.SybDriver"). NewInstance ();
String url = "jdbc: sybase: Tds: localhost: 5007/myDB";
/ / MyDB name for your database
Properties sysProps = System.getProperties ();
SysProps.put ("user", "userid");
SysProps.put ("password", "user_password");
Connection conn = DriverManager.getConnection (url, SysProps);

5, Informix Database

Class.forName ("com.informix.jdbc.IfxDriver"). NewInstance ();
String url = "jdbc: informix-sqli: / / 123.45.67.89:1533 / myDB: INFORMIXSERVER = myserver;

user = testuser; password = testpassword "; / / myDB name for the database
Connection conn = DriverManager.getConnection (url);

6, MySQL database

Class.forName ("org.gjt.mm.mysql.Driver"). NewInstance (); &
Class.forName ("com.mysql.jdbc.Driver");
String url = "jdbc: mysql: / / localhost / myDB? User = soft & password = soft1234 & useUnicode = true & characterEncoding = 8859_1"
/ / MyDB name for the database
Connection conn = DriverManager.getConnection (url);

7, PostgreSQL Database

Class.forName ("org.postgresql.Driver"). NewInstance ();
String url = "jdbc: postgresql: / / localhost / myDB"
/ / MyDB name for the database
String user = "myuser";
String password = "mypassword";
Connection conn = DriverManager.getConnection (url, user, password);

8, access database, ODBC-Direct Used

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc: odbc: Driver = (MicroSoft Access Driver (*. mdb));
DBQ = "+ application.getRealPath (" / Data / ReportDemo.mdb ");
Connection conn = DriverManager.getConnection (url ,"","");
Statement stmtNew = conn.createStatement ();

<! - EndFragment ->

相关文章
  • Database connection URL address Daquan 2010-10-08

    The following lists the various databases using the JDBC connection, it can be used as a guide. 1, Oracle8/8i/9i database (thin model) Class.forName ("oracle.jdbc.driver.OracleDriver"). NewInstance (); String url = "jdbc: oracle: thin: @ lo

  • Each database connection URL 2010-09-30

    1. Oracle url Example: "jdbc: oracle: thin: @ localhost: 1521: orcl" * 2. Access url example: "jdbc: odbc: HANFENG" * 3. SQLServer ur example: "jdbc: microsoft: sqlserver: / / localhost: 1433; DatabaseName = pubs" * 4. DB2 ur

  • How to connect sql server database connection pool configuration Tomcat 2010-02-24

    How to connect SQL Server database (Tomcat connection pool configuration) (reproduced) Source: http://www.blogjava.net/guming123416/articles/28002.html Version is relatively new, on-line many are saying is Tomcat 4, this is 5.0. How to connect SQL Se

  • DBCP database connection pool 2010-06-24

    Concepts: database connection pool for distribution, management and release database connections, it allows applications to reuse an existing database connection, instead of re-establishing a connection; release of free time over the maximum idle tim

  • Comparison of database connection pool 2010-11-03

    Now commonly used are open source data connection pool c3p0, dbcp and proxool three, of which: ¨ hibernate development team recommended c3p0; ¨ spring development team recommended dbcp (dbcp connection pool weblogic connection pool has the same probl

  • About Tomcat6.0 with the database connection pool configuration related issues 2011-09-08

    Method One: Adding in the server.xml configuration information that is "<GlobalNamingResources>" tag, the statement of the specific connection pool information, add the following: <Resource name = "jdbc / lian" <! - Resourc

  • October 19, 2010 database connection pool & URL rewriting 2010-10-19

    Feelings of deep learning day today. Am talking about the database connection pool. Very good topic. Is what I found when writing the project a solution to the problem. Access to the database, after all, have to face a problem. Use the database conne

  • JAVA Database Connection Daquan 2009-01-15

    Database Connectivity (JDBC) from a group with the Java programming language classes and interfaces. JDBC for tool / database developers with a standard API, so that they can use a pure Java API to write database applications. However, each developer

  • Daquan various database connection c # 2011-06-01

    C # SQL database connections in China trading network connects to the database of the steps: 1, the establishment of SqlConnection object; 2, the specified SqlConnection object's ConnectionString property; 3, open the database connection; 4, specify

  • JDBC technology and database connection pooling feature (reprint) 2009-10-02

    JDBC Basics First, access the database using JDBC basic steps: A. loading JDBC driver B. definition connection URL C. establish a connection D. create a Statement object E. execute a query or update F. The results dealing with G. Close the connection

  • Hibernate configuration file hibernate.cfg.xml to configure the database connection 2010-03-29

    If you are using hibernate developed, then a clear understanding of the hibernate configuration would be helpful. The following summary is to find the information and, if wrong, please let us point out, thank you ~ The following is on the JDBC connec

  • JDBC database connection backup 2010-03-05

    When doing database connection, often used in the MySQL and Oracle, but every time forget how to write connection string, look here to backup ... 1. Drive Class MySQL: com.mysql.jdbc.Driver Oracle: oracle.jdbc.driver.OracleDriver 2. Database URL MySQ

  • JDBC database connection pool 2010-05-07

    In tomcat6.0, server2000 database and connection pool configuration under myeclipse (with MySQL database similar) Tomcat 5 configuration data source data source with Tomcat 5.5 configured with many differences, Tomcat 6 of the data source configurati

  • jsp and database connection 2010-06-01

    (1) the mysql driver into the tomcat's lib in the driver is the http://ftp.up.ac.za/pub/windows/MySQL/Downloads/Connector-J/mysql-connector-java-5.1.6.zip There after extracting lib mysql-connector-java-5.1.6.jar. Put that file into tomcat's lib of 5

  • Transfer: an overview of java database connection specification 3.0 features and improvements new 2010-06-02

    Overview java database connection specification 3.0 new features and improvements josh heidebrecht ([email protected]) Software engineer, ibm July 2001 java database connectivity (java database connectivity, jdbc) api as java 2 Standard Edition (ja

  • commons-dbcp database connection pool technology 2010-07-15

    Work, met application needs a database connection pool. This is undoubtedly a challenge to the program performance. Why does the database connection pool? Because every time a new connection, resource-intensive. I do in their notebooks on the experim

  • Based Tomcat5.0 of Oracle10g database connection pool 2010-07-29

    It took three hours this afternoon, the time to study the look of Oracle10g on Tomcat5.0 database connection pool, would have thought that simple, because it was done based on Tomcat6.0 configuration SQLServer2005 database connection pool, that the t

  • Java connection pool using the Oracle database connection 2010-10-26

    1.Java four methods of connecting to the database program 1 JDBC-ODBC bridge and ODBC driver - in this way, this is a local solution, because the ODBC driver and the bridge code must appear in each user's machine. Fundamentally, this is a temporary s

  • java database connection pool configured in several ways 2011-01-03

    Java database connection pool configuration on several ways to meet today on the data source connection pool configuration questions, find there are many ways to configure, are summarized as follows, (has Mysql database as an example) A, Tomcat confi

  • A simple implementation of JDBC database connection pool 2011-01-06

    Of :snapbug From :CSDN   directory :   1. Introduction   2. Connection pool technology background   2.1 JDBC   2.2 JDBC Connection Pool   2.3 connection pool (ConnectionPool) And resource management   3. Simple JDBC Implementation of co