MySQL loads the JDBC driver and mysql loads the jdbc driver.
First, install the MySQL database. MySQL5.5 is installed. The installation steps are not described here. Please note that if the installation process stops at the start service and cannot continue, please refer to my blog post "when installing MySQL5.5, the start service does not respond, solution", it should help you solve the problem.
Nex
JDBC processes transactions and jdbc transactions
1. What is a transaction?
In the Personnel Management System, if you delete a person, you need to delete the basic information of the person, as well as the information related to the person, such as the mailbox and articles, these database operation statements constitute a transaction!
2. transactions must meet four conditions (ACID)
Atomicity ):A group o
JDBC: compile a JDBC program with an object-oriented approachBrief Introduction:Add student information to the data table, and query student information through the ID card number admission ticket.Name Type Nullable Default Comments----------------------------------------------Idcard number (10) YExamcard number (10) YSTUDENTNAME VARCHAR2 (20) YLACATION VARCHAR2 (20) YGrade number (3) YTest class
Package xu
Label:To create a JDBC application:We take the Mylibray authors table in the MySQL authoritative guide as an example Here are six steps to build a JDBC application:
Import the packet. You need to include packages that contain JDBC classes that require database programming. In most cases, you can use the import java.sql.*
Register the
JDBC and jdbc connect to the database
JDBC-development instance-MVC Mode
1. Configure the database connection information in web. xml
Web. xml:
2. Data Layer-create entity class Student. java
Student. java:
Package gh. test. entity;
Public class Student {
Private int id;
Private String name;
Private int gender;
Private int age;
Private String a
JDBC connection pool and dynamic SQL processing, jdbc dynamic SQLReview: 1. Create a properties configuration file first.
ClasssName = oracle. jdbc. driver. oracleDriverurl = jdbc: oracle: thin: @ Server IP: Port: Name user = set Username password = set password maxActive = maximum number of connections maxWait = maxim
JDBC Connection database, jdbc database
JDBC connection to the database is generally divided into three steps:
(1) register the database driver
(2) create a database connection URL
(3) obtain the Connection object
The Code is as follows:
1 try {2 // load the database driver and register it with the driver Manager 3 Class. forName ("com. mysql.
Basic Database Operation statements, JDBC programming steps, and jdbc programming steps
We don't know where to start when we get started with data, but in fact we only need to know a few basic operation statements, below I will briefly introduce the basic database operation statements and JDBC programming steps:
Connection command: mysql-h [host address]-u [user
JDBC (database connection and use), jdbc database
1. Introduction to JDBC
Quick StartPreparations:Ii. encoding stage:
Database connection process detailsIn development, the reflection method is generally used to register the driver. There are two advantages: 1. the driver is registered only once, improving efficiency. 2. You can extract the driver's full-outsourc
Tags: style blog color io os using Java AR forStart Thriftjdbcserver:CD $SPARK _home/sbinstart-thriftserver. SH To access the Thriftjdbcserver code snippet using JDBC: PackageCom.luogankun.spark.sqlImportJava.sql.DriverManagerImportjava.sql.ConnectionImportjava.sql.PreparedStatement/*** JDBC Code access thrift JDBC Server *@authorLuogankun*/Object Jdbcthriftserve
Spring integration JDBC template method design mode: inheritance-based implementation, jdbc Design Mode
Inheritance-based implementation of Spring integrated JDBC template method design mode:
A brief description of the template design mode:Extract the same part. When we run it, we automatically set the value to it and execute () in the source code of JdbcTemplate
J2EE--JDBC, jdbc
JDBC (Java Data Base Connectivity, java database connection) is a Java API used to execute SQL statements. It can provide unified access to multiple relational databases, it consists of a group of classes and interfaces written in Java. To put it simply, JDBC can do three things: establish a connection
JDBC and jdbc connect to the database1. Configure the program-Let our program find the driver jar package of the database
1. Copy the. jar file to the project to facilitate integration.
2. In the eclipse project, right-click "build path"> "Configure build path"> "Database"> "add external jar"> find the driver jar package of the database. Then, click "OK. The "referenced library" will appear in the left-side
JDBC and jdbc connect to the database
JDBC (java Database Access solution)JDBC defines a set of standard interfaces. Different database vendors implement these interfaces based on their own database features.JDBC process:1) load the driver and establish a connection 2) create a statement object 3) execute the SQL state
Improves the performance of JDBC batch operations and jdbc PerformanceJDBC
When you use the insert into... VALUES () statement to INSERT data in batches, you should use the JDBC PreparedStatement batch operation method instead of using one execution method.
For example (Source: http://superjavason.iteye.com/blog/255423 ):
For example, the Code has three key
1. Business
All update operations performed by a session either succeed together or fail together
For example:A to B transfer, transfer this process if there is a problem, the transaction can let the data back to the original "a account of the money has not changed, B account of the money has not changed." Case Description: /* * we To simulate the scenario of A to B account transfer * A and B accounts have 1000 dollars, now I let a account to B account 500 dollars *
1. Download the debug version number jar PackageThe first step is to download the JDBC Jar package for the debug version number, with the name of the jar package for the debug version number Jdbcx_g.jar (for example, as seen). The jar package for the debug version number, such as oracle11g, is Jdbc6_g.jar.Click here to download: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-09076
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.