Every time you do something, whether it is development or testing, you have to write the classes and methods that connect to the database. In fact, there is no big difference, in addition, the interface functions provided by the existing JDBC are still very limited. of course, if you use something like hibernate for development, these things can be left empty. even if you use DAO to connect to a database with a ready-made item, it is faster than you copy it.
So I wrote a general database connection package, which has three classes:
1. dbconn. Java: Mainly used to connect to and close the database. The URL to connect to the database. The user and password are used to complete COM/bcxy/util/systemconfig. properties through the configuration file.
2. sqlquery. Java: the SQL statement used to execute the query. constructor: sqlquery (connection con, string SQL); Save the result in the container.
3. sqlupdate. Java: Mainly used to execute the updated SQL statement. constructor: sqlupdate (connection con, string SQL );
In addition:
The jar package contains an util. *, which is mainly a common tool class. The following is a brief introduction:
It mainly includes
Stringutil. Java: some operations on strings
Dateutil. Java: operations on time
Fileutil. Java: operations on files
Systemconfig. Java: Read the configuration file systemconfig. properties.
Paramutil. Java: Page parameter passing operation
API documentation: http://www.bcxy.com/tools/bcxydoc/
Jar package and source file: http://www.bcxy.com/tools/bcxy.rar
The above is a summary of my work and will be improved all the time. I hope you will give more comments.
We also hope to provide you with some convenience.
If you have any questions, you can contact: webmaster@bcxy.com