I'm trying to input data into MySQL database through eclipse. Here's what I have so far:
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import com.mysql.jdbc.Statement;
public class MySQL{
public static void main(String[] args)throws Exception{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/database","root","root");
PreparedStatement stmt = con.prepareStatement("INSERT INTO 'database'.'Table'(Account_ID,First_Name,Last_Name) VALUES ('hello12','Ed','Lee')");
ResultSet result = stmt.executeQuery();}
}
It doesn't work for some reason...any ideas?
databaserather thenworkbench. Workbench is just the name MySQL gives to their database management tool. Anyways, back to your question can you give some excerpts from the error message you get...?