Step 1: introduce required packages, such as java. SQL. *, javax. SQL. *; Step 2: load the driver; Class. forName (StringclassName); Note: Another method is DriverManager. registerDriver (new Driver Class Name () (such as OracleDriver (); this method is not recommended in actual development.
Step 1: introduce required packages, such as java. SQL. *, javax. SQL. *
various Database Drivers
Database name
Description
Mysql
http://www.mysql.com/products/connector/j/
Shipped. But need to download the latest for MySQL 4.1 or higher.
Oracle
http://sourceforge.net/project/showfiles.php?group_id=33291Software/tech/java/sqlj_jdbc/index.html
Included.
SQL Server by Jtds
http://sourceforge.net/project/showfiles.php?group_id=33291
Tags: confluenceThis page provides all the JDBC driver download links for the supported databases.For license-based reasons, we did not integrate MySQL or Oracle database drivers into confluence, so you need to manually download and install the drivers before confluence starts.If you are using PostgreSQL or Microsoft SQL Server, the database
= rolestat.exe cutequery ();If (equiprs. getfetchsize () Equiprs. setfetchsize (20 );
However, if we call the setfetchsize () function of statement to set fetchsize to the expected value in advance, this will not cause the problem:
Rolestat. setfetchsize (20); // The setfetchsize () method of statement will not cause problems.Resultset equiprs = rolestat.exe cutequery ();
Therefore, we suspect that this is a bug implemented by Oracle
Demonstration classes that demonstrate situations in which JDBC accesses Oracle large data objects lob
Import java. Io .*;Import java. util .*;Import java. SQL .*;
Public class lobpros{
/*** Oracle driver*/Private Static final string driver = "
JDBC Driver downloads and connection string URL writing for various databases
JDBC Driver list on Sun's official website:http://java.sun.com/products/jdbc/reference/industrysupport/index.html
Database
Description
Mysql
http://www.mysql.com/pr
Thrown when running Jndi project: Org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot Create JDBC driver of class ' for connect URL ' null ' AbnormalWorkaround:1. Join the Oracle driver package under Tomcat 6.0\lib Ojdbc14_g-10.2.0.1.0.jar2. In the context.xml file under Tomcat 6.0\conf, add[JavaScript]View Plaincopy
1, to do the JDBC request , first to understand what this JDBC object is, and now take SQL Server as an example to illustrateFirst download the corresponding database driver (Baidu "JDBC SQL Server Driver" and then download).Note : After the download is complete, change the
Previously, Oracle9i was used. The project needs to use the 11G environment of the customer. The original
ProgramThe database cannot be connected correctly in the user environment. Therefore, I used the built-in 11g driver ojdbc5.jar (JDK version 5 and 6.
The Internet has changed many circles, but it has not been a result. After a few twists and turns, I finally want to see readme.txt. That sweat, readme is the first teacher of our teachers, but we
Original: Http://www.oracle.com/technetwork/database/enterprise-edition/memory.pdf Introduction
Oracle JDBC drivers may use a large amount of memory. This is a conscious design choice to weigh before using a lot of memory and improving performance. In most cases, this has proven to be a good choice for most users. Some users have experienced a problem with the large amount of memory used by the
1. Grant scott user connection permissions: Grant connect to scott;
2. Create a java project in Myeclipse to import the jdbc package (classes12.jar ):
Right-click the project bulid path-> add external archives and select classes12.jar.
3. Create a java file, lianxi01.java
ImportJava. SQL. Connection;
ImportJava. SQL. ResultSet;
ImportJava. SQL. SQLException;
ImportJava. SQL. Statement;
ImportOracle. jdbc.*
.jar.
First, see a class for database connection. In actual development, this class is used as a tool class, put it in the util package, and name it JdbcUtil.
Package util; import java. SQL. connection; import java. SQL. driverManager; import java. SQL. SQLException; public class JdbcUtil {public static Connection getConnection () {Connection conn = null; String url = "jdbc: oracle: thin: @ localhost: 1521
Format one: Oracle JDBC Thin using a ServiceName:Jdbc:oracle:thin:@//Example:jdbc:oracle:thin:@//192.168.2.1:1521/xeNote The format here, which is followed by//, which is the main difference from using SIDS.This format is recommended by Oracle because the SID for each node is different for the cluster, but the service_name can contain all nodes.Format two:
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.