Hi there,
try this:
Statement select = conexion.createStatement("SELECT * FROM tabla");
ResultSet resultadoSelect = select.executeQuery();
Joost
> -----Original Message-----
> From: Francisco Jesus Castillo Pinazo
> [mailto:[EMAIL PROTECTED]]
> Sent: donderdag 28 september 2000 3:51
> To: [EMAIL PROTECTED]
> Subject: access to mysql using java
>
>
> Hello Friends, I�m novice in JDBC and Servlets, so i need help.
>
> I�m trying to access to a remote mysql database using java, i
> receive a
> error when i access, it give
> me
>
> <!-- ERROR2 -->
> <!-- ERROR2 -->
>
> that is the code i use, is correct?
>
> try
> { String urlBD =
> "jdbc:mysql://sub.dominio.net/databasename?user=miuser&passwor
> d=mipass";
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> Connection conexion =
> DriverManager.getConnection(urlBD,"miuser","mipass");
> Statement select = conexion.createStatement();
> ResultSet resultadoSelect =
> select.executeQuery("SELECT * FROM
> tabla");
> select.close();
> conexion.close();
> } catch (SQLException e)
> { System.out.println("<!-- ERROR1 -->");
> System.out.println("<!-- " + e.getMessage() + " -->");
> } catch(Exception ex)
> { System.out.println("<!-- ERROR2 -->");
> }
>
> My CLASSPATH variable points to :
>
> :/usr/jre1.2/lib/elingo.jar::/usr/jre1.2/lib/mysql/mysql.jar:.:
>
>
> What is my problem? (.......that i�m novice)
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html