Label:JDBC is connected directly to the database using a Java-based database drive, while the JDBC-ODBC is connected to an ODBC data source, and the connection to the database is truly odbc! It is recommended to use a JDBC direct connection, preferably using a connection poo
Tags: What is JDBC? JDBC, called Java Database Connectivity Standard, is an object-oriented application interface (API) that allows access to a variety of relational databases. JDBC is also part of the Java Core Class library. The most important feature of JDBC is that it is independent of the specific relational d
Using the JDBC-ODBC bridge to connect to the Oracle database and JDBC driver is almost the same, so we don't have to set the environment variable. There are two key statements for connecting to the database in JDBC:
Class. forname ("oracle. JDBC. Driver. oracledriver ");Co
Create a database with access, and save it as D:/mydata. MDB.
There are two ways to connect to the Access Database: one is to directly use the access driver, and the other is to use the DSN link. We first define several variables in the method, filepath refers to the address of the database file, URL is the string linking the database, dbdriver is the JDBC-ODBC driver, DSN is the system defined DSN name.
Th
String url = new string ();Url = "JDBC: ODBC: Psy ";/*A database identification method is provided to enable the corresponding driverProgramIdentifies the database and establishes a connection with it.JDBC: Sub-Protocol: ODBC; Sub-Name: Local ODBC Data Source PsyODBC is a special case. The complete syntax is:
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. parseInt (strPage );
If (intPage1)IntPage=1;}
// Load the JDBC-ODBC driver
Class. forName ("sun. jdbc. odbc. JdbcOd
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. parseInt (strPage );If (intPage // Load the
The front section describes how to create a data source in win7. After creating a data source, you can use it in a Java program: Create a Java program and write the following code in it: [this article is from www.68idc.cn]. The test is successful and no error is reported. It indicates that odbc has been connected to jdbc.
The front section describes how to create a data source in win7. After creating a dat
For jsp servers set up in windows, and the system is relatively small, using access is a good choice, but to use an access database usually through the data source. Here we provide a method to directly connect to the data source without using the data source using java. The example program is as follows: importjava. SQL. *; publicclassAccess {publicstaticvoidmain (Strin AccessJDBCODBC
For jsp servers set up in windows, and the system is relatively small, using access is a good choice, but t
Today, there is a problem, although not a big problem, but for beginners also entangled me for a long time! (well)Problem:Running the JSP project does not connect to the database:Java.sql.SQLException: [MICROSOFT][ODBC Driver Manager] in the specified DSN, the architecture between the driver and the application does not match.I am using JDBC-ODBC Bridge connectio
The first step in using JDBC-ODBC bridgingConfigure the data sourceUsed in 32-bit systems and 32-bit JDK environments, and now basically eliminated, using JDBC directly is very useful.1. Enter the Control Panel2.3.4.User dns: Select this is the only SQL Server user can log in, (recommended)System DNS: Select this is the user of this computer can log inAdd: is use
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 connec
; // 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. parseInt (strPage );If (intPage // Load the
The JDBC ODBC brige driver is the driver for the JSP connection database, which is installed by default as long as the JDK is installed.To configure a JDBC ODBC data source: http://blog.csdn.net/lissdy/article/details/7059828Create WebApplication, refer to other articles in this blogCreate a JSP file under the WebApp d
a username and password
-Ct=drivermanager.getconnection ("Jdbc:odbc:mytest"); the
- //3. Create statement or preparedstatement[differences]
-Sm=ct.createstatement ();//statement use: used primarily to send SQL statements to a database -
+ //4. Execute (crud, create DATABASE, back up database, delete data ...) - //Demo Adds a piece of data to the course table, executeupdate can perform add delete and modify operations
+
= Java.lang.Integer.parseInt (strpage);
if (intpage
Load JDBC-ODBC Driver
Class.forName ("Sun.jdbc.odbc.JdbcOdbcDriver");
To set the database connection string
Strcon = "Jdbc:odbc:Test_DB";
Connecting to a database
Sqlcon = Java.sql.DriverManager.getConnection (Strcon, "sa", "");
To create an SQL statement object
sqlstmt = Sqlcon.createstatement ();
Get Total Records
strSQL = "SELECT count (*) fr
/* Demo JDBC-ODBC Bridge connection* 1. Configure the data source* 2. Connect to the data source in the program**/Package Shujuku;Import java.sql.*;public class Test1{public static void Main (string[] args){Connection Ct=null;Statement Sm=null;try {1. Load the driver (add the required driver to the memory)Class.forName ("Sun.jdbc.odbc.jdbcodbcDriver");2. Get ConnectedCt=drivermanager.getconnection ("Jdbc:od
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.