473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 9673
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

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

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
0
by: D. K. | last post by:
Hi; I have installed suse 8.2 a short while ago and at my first attempt to connect mysql (via shell and a perl dbi script) i get following error: can't connect to mysql server through socjet...
5
by: smatta | last post by:
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It is running but I cant connect to it using MySql Query Browser running on my pc. >From my pc, I can telnet to the sql...
1
by: Pratchaya | last post by:
Hi, All Can i write php code to connect 2 MySQL DB. like this case. ? My Environment : Server < ---- > PC Client Server =
2
by: zMisc | last post by:
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database. I've done the following: 1) Create a DSN for MyODBC. 2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data...
3
by: dmcquay | last post by:
Hi, I am setting up MySQL on a development box. I have set it up and can connect from localhost, but I cannot connect from another computer on the network. I have narrowed down the problem...
1
by: iceboy | last post by:
Hello to all,I have a problem to connect PHP & MySQL together. I have created a form that gets the username & password from admin and connect him to database.the part of PHP script that connect to...
5
by: maverickx | last post by:
Hi everyone, i am a totally rookie in perl. I have a project which needs to use perl to connect to mysql database. I already installed the perl mysql driver, MySQL, and use perl code which i found...
5
by: mtuller | last post by:
I would like to encrypt data passed between my web server and the database server. I have looked all over, but don't see any information on how to connect to mysql via ssh with php. Is it possible?
5
by: suma | last post by:
hi to all plaese help me i have same problem when download the phpdev and phptriad i cant connect to mysql when click the MyAdmin apear this messege in the page 'Warning: MySQL Connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.