IDEA realize the connection jdbc

Date: 2020/1/16

Function: IDEA realize the connection jdbc

IDE:Intellij IDEA

With mysql, for example,

Step One: Download mysql driver jar package

Official website address: https://dev.mysql.com/downloads/j/
Here Insert Picture Description

Step Two: Import jar package in the project, attention: imported must be decompressed jar package, can not import the archive file can not be found will be displayed

  1. After compression I import the file into your project
    Here Insert Picture Description
  2. Right Project - New Folder libs- jar package will be copied into the folder
    Here Insert Picture Description
  3. Click modules, on the right +, click out JARS or directories, is introduced into the jar file, click ok to
    Here Insert Picture Description
    4. Establish jdbc statement:
    establishing driven
    to establish connection object
    to establish the statement object
    obtained return header
    process the result
    Here Insert Picture Description
Published 76 original articles · won praise 2 · Views 2122

Guess you like

Origin blog.csdn.net/weixin_43476969/article/details/103998695