0

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.

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by peter_budo
0

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.