Jdbc Concepts - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

MySQL
MySQL
Error
Error
Number
Name
1241 ER_OPERAND_COLUMNS
1242 ER_SUBQUERY_NO_1_ROW
1247 ER_ILLEGAL_REFERENCE
1248 ER_DERIVED_MUST_HAVE_ALIAS
1249 ER_SELECT_REDUCED
1250 ER_TABLENAME_NOT_ALLOWED_HERE
1251 ER_NOT_SUPPORTED_AUTH_MODE
1252 ER_SPATIAL_CANT_HAVE_NULL
1253 ER_COLLATION_CHARSET_MISMATCH
1261 ER_WARN_TOO_FEW_RECORDS
1262 ER_WARN_TOO_MANY_RECORDS
1263 ER_WARN_NULL_TO_NOTNULL
1264 ER_WARN_DATA_OUT_OF_RANGE
1265 ER_WARN_DATA_TRUNCATED
1280 ER_WRONG_NAME_FOR_INDEX
1281 ER_WRONG_NAME_FOR_CATALOG
1286 ER_UNKNOWN_STORAGE_ENGINE

20.3.6. JDBC Concepts

This section provides some general JDBC background.
20.3.6.1. Connecting to MySQL Using the JDBC
When you are using JDBC outside of an application server, the
establishment of Connections.
Specify to the
to do this is to use
With MySQL Connector/J, the name of this class is com.mysql.jdbc.Driver. With this method, you
could use an external configuration file to supply the driver class name and driver parameters to use
when connecting to a database.
The following section of Java code shows how you might register MySQL Connector/J from
the
main()
Section 20.3.3, "Connector/J
CLASSPATH
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// Notice, do not import com.mysql.jdbc.*
// or you will have problems!
public class LoadDriver {
public static void main(String[] args) {
try {
Legacy
SQL
(X/
Standard
Open)
SQLState
SQLState
S1000 21000
S1000 21000
S1000 42S22
S1000 42000
S1000 01000
S1000 42000
S1000 08004
S1000 42000
S1000 42000
S1000 01000
S1000 01000
S1000 01000
S1000 01000
S1000 01000
S1000 42000
S1000 42000
S1000 42000
which JDBC drivers to try to make Connections with. The easiest way
DriverManager
Class.forName()
method of your application. If testing this code, first read the installation section at
Installation", to make sure you have connector installed correctly and the
set up. Also, ensure that MySQL is configured to accept external TCP/IP connections.
// The newInstance() call is a work around for some
// broken Java implementations
JDBC Concepts
DriverManager
on the class that implements the
2087
Interface
class manages the
DriverManager
java.sql.Driver
interface.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents