---
title: "经常接触的数据库驱动的链接方式"
author: "googya"
date: "2010-08-06T09:59:22Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2010-08-06T09:59:22Z"
id: 730615
url: "https://googya.iteye.com/blog/730615"
---

各种数据库的驱动在写法上还是存在一点差异的，比如SqlServer和PostgreSQL在感觉上存在很大的差异。
     PostgreSQL：
    
```java

    String connectionUrl = "jdbc:postgresql://192.168.100.207:5432/MySQL";
    Class.forName("org.postgresql.Driver");
    Connection conn =
      DriverManager.getConnection(connectionUrl,"test","test");
    
```



    SqlServer：
    
```java

    String connectionUrl = "jdbc:sqlserver://192.168.1.1;"
	      + "databaseName=MySQL;user=test;password=test123";
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection conn =
      DriverManager.getConnection(connectionUrl);
    
```


to be continued。。。。。。