Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » learning(i am new on this)
learning [message #1832238] Mon, 14 September 2020 01:18 Go to next message
victor checo is currently offline victor checoFriend
Messages: 2
Registered: September 2020
Junior Member
hi everybody.
i have found one video explaining how i connect to a database in mysql, soy i followed the instruction.
import java.sql.*;

public class conexion{
public static void main(String[] args) {
try {
class.forname("com.mysql.jdbc.driver");
DriverManager.getConnection("jdbc:mysql://localhost:3306/contratosinternos","root","");
System.out.println("todo bien");
} catch (ClassNotFoundException e) {
System.out.println("error en conexion");
e.printStackTrace();
// TODO: handle exception
}catch(SQLException e){
System.out.println("error en consola");
e.printStackTrace(); }
}
}
but for some reason, eclipse say than class, in the line that i put class.forname, is an invalid expresion, some help? please
Re: learning [message #1832240 is a reply to message #1832238] Mon, 14 September 2020 03:06 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3834
Registered: July 2009
Senior Member

Java is case sensitive. "class" should be "Class".

Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Mon, 14 September 2020 03:06]

Report message to a moderator

Re: learning [message #1832260 is a reply to message #1832240] Mon, 14 September 2020 12:48 Go to previous message
victor checo is currently offline victor checoFriend
Messages: 2
Registered: September 2020
Junior Member
thaks, i will try it.
Previous Topic:Error Installing dl.google.com/eclipse/plugin/4.5
Next Topic:None displaying characters
Goto Forum:
  


Current Time: Mon Sep 21 18:26:15 GMT 2020

Powered by FUDForum. Page generated in 0.03102 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top