DirectoryPreface: What is JDBCI. Preparatory work (i): MySQL installation configuration and basic LearningIi. preparatory Work (ii): Download the jar package for the database and import itThird, JDBC Basic operation(1) Define the class of the record (optional)(2) access to the connection(3) Insert(4) Update(5) Select(6) DeleteIv. TestingFive, Code AnalysisSix, the question of thinkingPreface: What is JDBCIntroduction to Wikipedia:
A
BigInteger support
To register the JDBC driver:Before using it, you must register your driver in the program. The registration driver is loaded into memory by the Oracle driver's class file so that it can be used as the implementation of the JDBC interface.
Need to do this registration only once in your program. You can register one driver in one of the following two ways.
Method (I)-Class.forName
1. What is JDBC? What's the role?Java data Base Connectivity Java Database Connection protocolis a Java API for executing SQL statements that provides unified access to a variety of relational databases.He provides a benchmark to build more advanced tools and interfaces that enable developers to write database applicat
, Filteredrowset, Jdbcrowset, Joinrowset, RowSet, Syncresolver, Webrowset
ResultSetextends Wrapper
A data table that represents a database result set, typically generated by executing statements that query the database.
Six, the question of thinking1. Each SQL operation needs to establish and close the connection, which is bound to consume a lot of resource overhead, how to avoid? Analysis: You can use a connection pool to maintain a unified connection without having to
freshman year. Then my sophomore year and my freshman year said, "A driver package is required for database connection. You can learn about and download it yourself, if you do not want to solve the problem, you must learn to solve the problem. My brother did not provide me directly, and it took me a few days. So this year I have done a good job and remind you to pay attention to it ...", When I heard this, I couldn't help but feel bad about it... (^ _ ^, This does not blame me. If you have any
Tags: pen database connection from ring username TCO OCA requires. sqlGoing on In the previous two sections the power a dangerous the servlet and the JSP wave. However, these things from our actual development still have a long distance (at least the job can not be completed =-=), so want to go further close to the actual development, it must have a certain degree of knowledge of the database to grasp and understand (here for a moment, the database is a branch of discipline, minutes to make big)
Label:Java Connection to Oracle database JDBC (Java Data Base Connectivity,java database connection), then how do we use Java to connect the database? importjava.sql.connection;
importjava.sql.drivermanager;
importjava.sql.preparedstatement;
importjava.sql.resultset;
importjava.sql.sqlexception; publicclassjdbc{Public
Java Web series: JDBC basics, webjdbc
The corresponding technology of ADO. NET in Java is JDBC, the enterprise database DataAccessApplicationBlock module corresponds to the spring-jdbc module in Java, and the corresponding ORM of
(OCI)@ 172.0.0.1 = localhost: IP Address1521: Port NumberXe: Database Name (Select name from V $ database)Connect MySQL to the databaseClass Full name: COM. MySQL. JDBC. DriverURL: JDBC: mysql: // localhost: 3306/Database Name
3. Create a statementStatement creation method: conn. createstatement ();Purpose: Execute static SQL statements;Execute (string SQL );Different results are returned based on differen
is executed, the CallableStatement GetXXX method retrieves the value of the parameter. The correct getxxx method is the Java type that corresponds to the JDBC type that is registered for each parameter. In other words, Registeroutparameter uses the JDBC type (so it matches the JDBC type returned by the database), and
JDBC (Java DB Connection)---Java database connectionJDBC is a Java API (applicationprogramming interface Application design interface) that can be used to run SQL statements. It consists of classes and interfaces written in some Java languages.JDBC provides a standard applic
Tags: conditions own local and apply function LAN exe ORAWe know that JDBC in Java is used to connect applications and data systems, and this article mainly looks at the implementation and usage details of JDBC. Mainly includes the following points:
Basic knowledge of JDBC (data driver)
Connection configu
Sample Publisher: Flyfox
A database connection is the most important part of a dynamic web site, and the technology for connecting to the database in Java is JDBC (Java Database Connectivity). Many database systems have JDBC drivers, and Java programs connect to databases t
intPage; // The page number to be displayed.Java. lang. String strPage;Int I, j, k; // set the number of records displayed on one pageIntPageSize = 5; // get the page number to be displayedStrPage = request. getParameter ("page ");If (strPage = null ){// Indicates that the QueryString parameter does not contain the page parameter. The first page of data is displayed.IntPage = 1;} Else {// Converts a string to an integer.IntPage = java. lang. Integer.
not contain the page parameter. The first page of data is displayed.
Intpage = 1;
} Else {
// Converts a string to an integer.
Intpage = java. Lang. Integer. parseint (strpage );
If (intpage
// Load JDBC-ODBC driveProgram
Class. forname ("Sun. JDBC. ODBC. jdbcodbcdriver ");
// Set the database connection string
Strcon = "
Tags: new localhost ade identity vendor read by example comData persistencePersistence (persistence):
Save the data to an off-the-shelf storage device for later use. In most cases, especially for enterprise applications, data persistence means that the data in-memory is saved to the hard disk to be "cured", and the implementation of the persistence process is mostly done through a variety of relational databases.
The primary application
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.