mysql in java error connection

SOF - Dragone Jose Luis <[email protected]>
Newsgroups gmane.comp.db.mysql.java
Message-ID <CFB3544036F8D843A51AAF13555A5BD7951C79@exch4-srv.cajval.sba.com.ar>
Sorry if the answer is already in the archives but: 

 

 I have no idea on how to connect to MySQL 4.1.11 using java 1.5

 

I'm trying this way:

 

public static final String DRIVER = "com.mysql.jdbc.Driver"; // this one
exist and is in : src/com/mysql/jdbc/Driver.java

 

public static final String URL_JDBC =
"jdbc:mysql:host-ip-number:3306:databasename:username:password"; // I think
the problem is here

 

public MySQLDAOFactory() {

        try {

            Class.forName(DRIVER);

        } catch (ClassNotFoundException e) {

            System.err.println("DRIVER not loaded");

            e.printStackTrace();

....

 

public static Connection createConnection() throws SQLException {

        return DriverManager.getConnection(URL_JDBC);

 

BUT I GET this ERROR in DEBUG

 

insercionjava.sql.SQLException: No suitable driver

      at java.sql.DriverManager.getConnection(DriverManager.java:545)

      at java.sql.DriverManager.getConnection(DriverManager.java:193)

      at dao.MySQLDAOFactory.createConnection(MySQLDAOFactory.java:28)

      at dao.MySQLPersonaDAO.insertarPersona(MySQLPersonaDAO.java:11)

      at
dao.InsertarDatosPersonales.insertarFila(InsertarDatosPersonales.java:62)

      at
dao.InsertarDatosPersonales.actionPerformed(InsertarDatosPersonales.java:72)

 

thanks

 

Jose

 

*** ADVERTENCIA *** - El contenido del presente mensaje y los archivos
adjuntos que pudiera contener son privados, estrictamente confidenciales y
exclusivos para su destinatario, pudiendo contener informacion protegida por
normas legales y de secreto profesional. Bajo ninguna circunstancia su
contenido puede ser transmitido o revelado a terceros ni divulgado en forma
alguna. En consecuencia de haberlo recibido por error, rogamos contactar al
remitente y eliminarlo de su sistema. No nos responsabilizamos por la
integridad y la seguridad de este mensaje, ya que el mismo podria estar
sujeto a manipulaciones ilegales de informacion. *** WARNING *** - The
information transmitted is intended only for the person or entity to which
it is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of any
action in reliance upon, this information by persons or entities other than
the intended recipient is prohibited. If you received this in error, please
contact the sender and delete the material from any computer. The integrity
and security of this message cannot be guaranteed and it may be subject to
unauthorized amendment, for which we accept no liability.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.