I am trying to establish connection between net beans ide and mysql client using wamp server (for mysql server facility).
As i have been executing this GUI application successfully using the following code from console but it is generating error while execute on Netbeans ide.
it is giving following error msg.
I have register my mysql server to database service. and it is listing server path in the Services window.
Please suggest what more improvement i can make in this code to establish a connection between Netbeans ide and MySQL database client via Wamp server as mysql server.
sailaja koney wrote:since its a desktop application and the jar files are in-built.. it should work.
1.the wamp server is running.
2. NetBeans - window - services - databases - Drivers - MySql connector is available.
actually sir/ma'am, all these things/softwares are running properly. But still I m not able to establish an connection with mysql server. I have copied latest .jar file for MySQL JDBC Connector /J at the exact location.
However i would like to introduce you one more figure that will show something. Please pay attention to graphic put before driver string at left hand side.
It says (as i have guessed) that it had properly connected with server but unable to establish any connection, while same code is working good without netbeans IDE.
I think there is some mistake in the way I am trying to achieve this goal. Please make me correct if I m really going down to wrong way.
is there any problem by the different name of ab-jdbc driver name.?
sailaja koney wrote:
probably, you are mentioning the database name twice....
can be like this..
String URL = "jdbc:mysql://localhost:3306/";
String db ="test";
oh i m sorry, i was not aware about this big mistake, however, i have made these changes.. and still i m not able to get connection object initialised with Connection. < i just have debugged using break point >
I have uploaded one more image, and i am not aware about this whether it is important to fill these values or not. if yes then, what values can be fill here.
UPDATE @1827 hrs
i have supplied these values in mysql admin tool window. (all values are from adcending order)
path/url to admin tool: %root%:\wamp\bin\mysql\mysql5.5.16\bin\mysqladmin.exe
path to start command:
path to stop command:
argument: -u root stop
UPDATE 1910 hrs
i made above changes with the help of this link Connecting to a MySQL Database - NetBeans IDE Tutorial
if you don't mind i would like to know how to add this build path in net beans ide.
i have wrote all these code in try /catch block, so i don't get much error except the name of driver that is com.mysql.jdbc.Driver.
UPDATE: Do you meant to change "Ant Home Path". Is it what that compile our java source code.??
sailaja koney wrote:place the jar file here..
C:\Program Files (x86)\Java\jre6\lib\ext\
and open net Beans
right click on your project-go to properties-libraries-there you will find the Add Jar/Folder.
add the above mentioned file there.
Thank you so much Sailaja Koney ji..!!
Finally, with your constant help I have get compiled successfully this connectivity issue in net-beans too.
Thank you soo much for joining this thread.