How to write Sqlserver,db2,informix,sybase,postgresql's Jdbcurl

Source: Internet
Author: User
Tags db2 informix odbc postgresql sybase
Server|sqlserver JDBC-ODBC configuration or configuring SQL Server with DataSource although it is convenient to look at the link, it is difficult to handle the result set to truly achieve the JDBC2 standard, so you want to be a little "professional" or
SQL Server's JDBC itself to connect.
Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn= drivermanager.getconnection (Url,user,password);
However, if the URL is written, because ODBC is simply configured with the data source (refers to the DataSource in the MS System configuration), DataSource (refers to the DataSource of Jdni technology registration in the Jsp/java IDE)
As long as you write the relevant attributes, the system will find the relevant links for you, and there are few examples of how a complete URL for SQL Server can be written. It's really simple.

String url= "Jdbc:microsoft:sqlserver://hostname:port;databasename=pubs";
Generally speaking, port is 1433. In fact, the URL is written in what format, is completely JDBC implementation of the developer's interest, they do not follow the uniform standard to write, we have to use his JDBC can only be based on their interest to write.

Here are some other databases that are not commonly used JDBC, to illustrate that only the general JDBC is done, some of the same database JDBC by different developers to implement, they may not write, but most of the case:

DB2:
String url= "Jdbc:db2://localhost:5000/sample";

Informix:
String URL =
"Jdbc:informix-sqli://123.45.67.89:1533/testdb:informixserver=myserver;
User=testuser;password=testpassword ";

Sybase:
String url = "Jdbc:sybase:tds:localhost:5007/tsdata";

PostgreSQL:
String url = "Jdbc:postgresql://localhost/soft"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.