Hi friends
I have been developing a web application in mvc which is in need of using database mysql.
I am suffering from the same problem we are discussing for the following code.
I am collecting the data for the tables from a form.
I had added mysql-connector-java-5.1.17.zip by right clicking the libraries of my project

try
                {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/gopi","root","root");
                    PreparedStatement pst;
                    System.out.println("I am creating a connection");
                    pst= connection.prepareStatement("INSERT into Complaint values(?,?,)");
                    pst.setString(1,StreetName);
                    pst.setString(2,Hole_Size);
}

Can anybody help me please.

Recommended Answers

All 2 Replies

Welcome to Daniweb.
Firstly, this post was 3 years old. You should have created your own Thread when posting your question.

I had added mysql-connector-java-5.1.17.zip by right clicking the libraries of my project

I think you need to add the .jar file , not the .zip

I had added mysql-connector-java-5.1.17.zip by right clicking the libraries of my project

You want to extract that zip and use only JAR file from it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.