First drag the jar package to webroot-> WEB-INF-> Lib.
In this way, the referenced libraries folder also contains the relevant jar package.
Open dB brower
Create, taking sqlserner2005 as an Example
JDBC: sqlserver: // rewrite in <SERVER_NAME >:< port> [; databasename = <dbname>]
For example, JDBC: sqlserver: // 10.187.202.145: 1433; databasename = News)
SERVER_NAME is the IP address, port is the port number, and <dbname> is the database name
Then modify the sqlhelper. Java file.
Private string drivername = "com. Microsoft. sqlserver. JDBC. sqlserverdriver ";
Private string url = "JDBC: sqlserver: // 10.187.202.145: 1433; databasename = News ";
Private string username = "sa ";
Private string userpassword = "hicc ";
Here, drivername can be automatically generated. Create another project and add hibernate
When the DB driver is set to a new one, the drivername is automatically generated.
In this way, you can use sqlhelper.