Java uses JDBC technology to operate SQLSERVER database instance code

JDBC (Java Data Base Connectivity) is a Java API used to execute SQL statements. It can provide unified access to a variety of relational databases. It is composed of a group of classes and interfaces written in Java language. JDBC provides a benchmark, based on which more advanced tools and interfaces can be built to enable database developers to write database applications. JDBC and You can't access the database directly. You need to use the jdbc driver provided by the database manufacturer.

Database connection

If you want to access the database in Java, you must first load a database driver. The database driver only needs to be loaded once for the first access. Then create a connection instance every time you access the database to obtain the database connection, so that you can execute the SQL statements that operate the database. Finally, release the connection to the database after use.

Database driven class

Different databases implement different JDBC interfaces, so different database driver packages are generated. The driver package contains some classes responsible for database connection and passes the SQL statements we want to operate into it. My PC uses sql2012, so we're going here http://www.microsoft.com/zh-cn/search/DownloadResults.aspx?q=jdbc Download driver

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>