This content has been marked as final. Show 4 replies
make sure you have this driver on your classpath
Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8080//test","root", "password"); Statement stat = con.createStatement();
what do you mean by "connecting to MySQL from Eclipse"
i believe u are trying to connect from a Java program which u r running from Eclipse.
User the mysql connector jar. add it to your classpath then use this:
Hi i need to get The code Snippet for connecting to MySQL from Eclipse
cause MY DSN doesnot show a mySql(SUN) driver only a SQL Server (MIcrosoft) driver
so i am Stuck ....Help
mySQL server is running on PORT 3306 uname-root password-password
i even have a mySQl Connector plugin from eclipse but that doesnot help...
Class.forName("org.gjt.mm.mysql.Driver").newInstance(); con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/yourDB", "root", "password");