Server|sqlserver
I. Application of JDBC-ODBC Bridge
1. Building databases and tables in SQL Server
2. Create a data source]
(1) Start-> Settings-> Control Panel-> admin tools->odbc Data Source
(2) Click the Add button under the User DSN to eject the Create Newdatasource dialog box
(3) Select Sqlserver-> Complete
(4) Specifies that name is your data source name, server is the IP address of the host computer where the SQL Server is located, and if it is local, it can be localhost,127.0.0.1.
(5) Select With...............by User, set username and password
(6) Select Change the default database to:
Select the appropriate database in the Drop-down list
(7) Test DataSource (test data source), failed to return third step reconfiguration.
3. Example
(1) Create the XS database in SQL Server and create the XS table in the XS database with the following fields:
Name
Sex
Age
Cjp
Male
22
(2) Configure the data source according to the 2nd step above, named XS
(3) Code:
Import java.sql.*;//SQL Package
public class XS {
public static void Main (string[] args) throws exception{
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.