Java JDBC connection and use details
•
Java
Java JDBC connection and use
jdbc
Import driver
//Jar is a packaged set of class files that can be referenced in other projects / / add external jars in build path is imported
Connect to JDBC
1. Load drive
Create connection
2. Be sure to close the database after it is opened.
1. Execute SQL statements (create table, insert, delete, update)
Using statemant
Using preparestatement
Can I use? Placeholders to replace the parameters you need to pass
1. Query
Here is a small program
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
二维码