468,541 Members | 1,811 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,541 developers. It's quick & easy.

i want to connect wamp MySQL to my netbeans project

I want to connect wamp:phpmyAdmin: mysql database with my netbeans java project. i wrote all connection code and also connect "mysql-connector-java-5.1.11-bin" and there is no error but when i'm running program that time it dose not working.
I want to Select and update data from wamp...
tell me how can i do this.....................
Mar 26 '13 #1
5 9046
r035198x
13,262 8TB
What do you mean by "does not work"? Do you get error messages?
What is the code that is not working? MYSQL, Java, PHP? you need to give people enough information for them to be able to help you.
Mar 26 '13 #2
i wrote java code in NetBeans.
and I did't get any error msj it successfully run but on the out put screen my database data are't show...
Mar 26 '13 #3
r035198x
13,262 8TB
Put System.out.println statements showing the values of your variables to see why there is not data. Otherwise you'd have to post the relevant code.
Mar 26 '13 #4
under these my netbeans code.....



Expand|Select|Wrap|Line Numbers
  1. Class.forName("com.mysql.jdbc.Driver");
  2.             Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/cloud", "root", "");
  3.             Statement stmt = con.createStatement();
  4.             String query = "select * from user";
  5.             ResultSet rs = stmt.executeQuery(query);
  6.             while (rs.next()) {
  7.                 String name = rs.getString("uname");
  8.                 System.out.println(name);
  9.             }
Mar 26 '13 #5
r035198x
13,262 8TB
1.) Use code tags when posting code.

2.) If this is a problem with Java code then it should be in the Java forum not MySQL forum.
3.)So nothing prints out to the console? Check that (a) There actually is data in the database and (b) that your code is not hiding exceptions.
Mar 26 '13 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Mr Dygi | last post: by
3 posts views Thread by dmcquay | last post: by
5 posts views Thread by maverickx | last post: by
5 posts views Thread by mtuller | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.