JDBC use cases

A result data acquiring centralized entity set value and, encapsulated object is returned;

 

 

 

 2, the package tools JDBC

Whenever the time, such as reading the configuration file, the write static code block;

An exception is thrown to specify the method can throw, static code block abnormal only capture try catch;

Class loader two functions: Class file byte code is loaded into memory; src acquired file in the path;

2.1 Gets drive object

 

 

 

 among them. A URL is a Uniform Resource path, to get the absolute path string type by getPath () method;

IO flow properties and binding ensemble used:

 

Reads the value in the configuration file:

 

 

 2.2 Gets the connection object

 

 2.3 Method release of resources

 

 Third, the use of JDBC tools - Sign Case

 

 

 

Guess you like

Origin www.cnblogs.com/wmqiang/p/11600701.html