NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Adding the mySQL Library

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
lewisposner



Joined: 07 Sep 2011
Posts: 1

PostPosted: Wed Sep 07, 2011 11:59 am    Post subject: Adding the mySQL Library Reply with quote

Hi all,

I hate to ask what seem like an obvious question but Im having some trouble installing the mySQL library into a project.


I have downlaoded the connector from mySQL. I right click on my project name and then selected properties. I have then selected libraries and Add/ JAR/FOLDER add added the relevant mySQL jar connector. The library loads fine and I can see it under the libraries tab of the project. However when I then try to use a method or protocol from that library it dosnt exisit.

For example

try{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306"
+ "/test", "username","password");

Statement stmt =(Statement) con.createStatement();

String name ="lewis";
String lastName = "posner";

String test ="INSERT INTO new_table VALUES('Lewis')";


}catch(Exception e){

}
I now want to upload this by using sending stmt.executeUpdate(test);
However the method executeUpdate dosnt exist.

I hope that make sense? can anyone help me please would really appreciate it.

Thanks
Lewis
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo