Java Foundation - JDBC Accessing Database
**
Java Foundation - JDBC Accessing Database
**
JDBC, full name Java DataBase Connectivity. It provides a variety of methods, including access to the database, execution of sql statements and so on. The classes that operate on the database are all in the java.sql package. Here are some steps to link the database through JDBC.
Load the J ...
Posted by WD.Gh0st on Mon, 15 Apr 2019 23:24:32 -0700
JDBC Learning Notes
JDBC operates on MySQL database diagrams:
JDBC simple column:
//Import Driver Class Library
//Registration driven
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
//Connect to the database
String user="root";
String password="mysql520";
Connection conn = DriverManager.ge ...
Posted by noobie_daddy on Mon, 15 Apr 2019 00:33:33 -0700
Experiments: MySQL performs batch performance tests using JDBC
Test preparation
Database: MySQL Server 5.5.40
System: Windows 7, Core (TM) i3-4160@3.6HZ, Arch x64
Database driver: mysql-connector-java.5.1.9
JDK environment JDK 1.7.0_75 x64
Experimental requirements
(1) Insert 10,000 pieces of data at a time, then delete them, and execute them 10 times in total.
(2) Using MyISAM and InnoDB engine ...
Posted by hyd_guy on Sun, 14 Apr 2019 10:54:31 -0700
Five Suggestions for Neo4j and Cypress Rapid Batch Update
Links to the original text: http://jexp.de/blog/2017/03/5-tips-tricks-for-fast-batched-updates-of-graph-structures-with-neo4j-and-cypher
Note: After testing, I modified some of the Cypher statements in the original text to conform to the grammatical rules.
When writing large amounts of data to a graphical database through a program, yo ...
Posted by Ghettobusta on Sun, 14 Apr 2019 09:45:33 -0700
How to implement transaction management in Controller layer?
stay spring aop transaction management We found that we implemented transaction management in service layer.
Now there are the following scenarios. Let's discuss how to achieve them.
Controller A, Controller B, Controller C... Depending on ServiceA and ServiceB, the save d operation of the above-mentioned Controller needs to synchronize the ...
Posted by BuzzLY on Wed, 10 Apr 2019 15:48:31 -0700
Practical reflection mechanism of Java
Java's reflection mechanism is especially suitable for large-scale projects, especially multi-functional projects. Because it greatly reduces the time of static loading classes at compile time and reduces the initial memory consumption.
Why is there a reflex mechanism?
1. When it comes to some applications, we often need to upgrade dynamic ...
Posted by aayatoos on Sun, 07 Apr 2019 21:48:31 -0700
JDBC Review 2 Prepared Statement and Statement
Procedures for database operations are basically add, delete and modify, but we generally do not use deletion, the main reason is that in large-scale development, we delete statements only change the value of a field to hide it, so that we can retain all the information of users, and then analysis, or avoid some unnecessary trouble.
DML: Data ...
Posted by leszczu on Sun, 07 Apr 2019 17:57:30 -0700
Talk about how to program and implement transaction management in Spring
Spring provides the template class org. spring framework. transaction. support. Transaction Template for programmable transaction management, which can meet the needs of some special occasions.
Transaction Template is thread-safe, so you can share Transaction Template instances in multiple classes to achieve transaction mana ...
Posted by umer on Sat, 06 Apr 2019 18:57:30 -0700
4.Mapper.xml Mapping File Details
Important attributes in tags in mybatis:
1. parameterType (input type)
First understand: #{} and ${} usage # {} implements setting parameter values to prepareStatement preprocessing statements. In sql statements #{} represents a placeholder, that is?.
The use of placeholder {} can effectively prevent sql injection, and mybatis automatical ...
Posted by texelate on Fri, 05 Apr 2019 20:21:30 -0700
MyBatis Annotation Development
Article directory
1. Entity class
2. Configuration file
3. Persistent Mapping Interface
4. MyBatis Tool Class
5. Service Class
6. Application Layer
1. Entity class
Create entity classes corresponding to database tables.
Cake
public class Cake {
private Long id;
private Long categoryId;
private String name ...
Posted by g.grillo on Thu, 04 Apr 2019 19:48:30 -0700