Document directory
Required Preparations
Connected theoretical knowledge
Connection test
Perform SQL operations in Java
Required Preparations 1. Install MySQL. For more information, see http://blog.csdn.net/jueblog/article/details/9499245 、to download the JDBC driver. You can download from the official website, or click the http://download.csdn.net/detail/oyuntaolianwu/5822697 to download 3, in eclips
The first thing to know about JDBC: the technique of sending SQL statements using Java code is JDBC technology. That is, JDBC is an interface for different databases (Oracle, MySQL, SQL Server). ) of the operation. Prerequisites for sending SQL statements using JDBC:Log on to the database server (connect to the databas
Differences between Classes12.jar,ojdbc14.jar,ojdbc5.jar and Ojdbc6.jar, the difference betweenWhen using the Oracle JDBC driver, are there some problems that you can solve by replacing different versions of the Oracle JDBC driver? There are multiple versions of the most commonly used ojdbc14.jar, and there are multipl
Java uses JDBC Connection database to do JSON encapsulation and parsing examples
This example is an example of using SOLServer2007 to connect a database with JDBC and to query the data format encapsulated into JSON.
Directly on the code--
Main function
Package Com.kuatang.jsondatas;
Import Java.io.File;
Import java.util.ArrayList;
Import Java.util.HashMap
connect to their own databases, database developers have to write their own classes that implement these interfaces and then turn them into jar packages for programmers, so that the program can read the data in the database as long as the programmer adds the jar packages to the project. The operation classes that implement interfaces are called driver classes.3.JDBC Common Interface Introduction (below the java.sql package):Dirvermanager (Driver Admi
stream.File file = new file ("D: // proxy.txt ");Inputstream fin = new fileinputstream (File );// Write the input stream to the output streamByte [] B = new byte [blob. getbuffersize ()];Int Len = 0;While (LEN = fin. Read (B ))! =-1 ){Outstream. Write (B, 0, Len );}// Close in sequenceFin. Close ();Outstream. Flush ();Outstream. Close ();}Con. Commit ();Con. Close ();2) another amazing thing is to call some functions in the dbms_lob package for processing, and the efficiency seems to be good.Ho
acquisition are The Abstractplatformtransactionmanager.gettransaction method completes theFor @transaction (propagation=propagation.supports), lazy gets connection when lazy gets the session, and only when the database operation is actually attempted.The simple stack that gets connection is as follows.Connectionmanager.openconnection () line:446//Note: Find no connecti
How to connect to and operate Oracle databases using JDBC
Learn before. NET, ODBC was used to connect to the database, while JDBC is usually used in Java to connect to the database. Here we take the oracle database as an example to briefly summarize how to connect to and operate the database using
driver, do not be "driven" two words frightened, (drive is an executable file and a connection string). It's simply a matter of connecting strings. The standard connection string is as follows: Class. forname ("Oracle.jdbc.driver.OracleDriver"); Connection con = DriverManag
betweenWhen using the Oracle JDBC driver, are there some problems that you can solve by replacing different versions of the Oracle JDBC driver? There are multiple versions of the most commonly used ojdbc14.jar, and there are multiple versions of Classes12.jar, do you understand?Co
is not the same; Is it really arp cheating, very excited ah, a mail poke into the network room, the problem seems to solve;However, the administrator checked the next MAC address, this MAC address is the second node of the-_-, that is, two hosts have the same MAC address, Oracle put us all pit;Check two host IP, do have a scan address, the spot directly without words, on the MoS bar, this problem ....Keyword: Duplicate scan VIP on both node search, t
On the basis of jdbc, advanced step C3p0 connection pool (DBCP cannot read xml configuration files and has been eliminated) and use of two main classes of QueryRunner and ResultSetHandler in DBUtils,
First, check the C3p0 connection pool. The biggest advantage is that the default configuration file can be automatically read.
The configuration file contains four
/** the JDBC database driver. */Specifies the connection driver public static final String db_driver = "DRIVER"; /** the JDBC database URL. */connection string public static final Strin
The JDBC driver of Informix is type 4.
1. Environment DescriptionOS: Windows XPInformix: IDS V10.00.TC1JDBC: Informix JDBC Embedded SQLJ V2.20JC22. JDBC ConfigurationAfter Informix JDBC is installed, add the ifxjdbc. jar path to the CLASSPATH environment variable, for example, CLASSPATH = C: \ ifxjava_home \ lib \ ifxj
Oracle JDBC: Driver version differences and differences [go], oraclejdbc
Classes12.jar, ojdbc14.jar, ojdbc5.jar, and ojdbc6.jar
When using the Oracle JDBC driver, do you solve some problems by replacing different versions of the Oracle
box appears, enter the name of the data source in the data source name "Jdbc-odbc", click the Select button, select the database to operate "Student.mdb", click OK button to complete the configuration of the data source. As shown in the figure:
4, the data source configuration is good, you can write to get the connection code, as follows:
Copy Code code as follows:
Class.forName ("Sun.j
Recently, I was working on an azure Cloud project. The front-end is the Java code. The Java code uses the JDBC driver to access SQL azure.
After a JDBC connection string is used, it is found that the connection times out in about 2 minutes, and it can work normally on SQL Se
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.