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.
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.
i have updated this .jar and still not able to execute the application. i have been facing same error..
thanks
Nikhil B. Singh
Greenhorn
Joined: May 20, 2012
Posts: 18
posted
0
Actually i m working on desktop application. and i m using 'wampserver' to provide mysql server facility and i have no idea how to give the path to my project. Please throw some light on this issue as well.
Welcome to the ranch Nikhil, hope you get plenty of help (but I can't offer any)
Nikhil B. Singh
Greenhorn
Joined: May 20, 2012
Posts: 18
posted
0
Wendy Gibbons wrote:Welcome to the ranch Nikhil, hope you get plenty of help (but I can't offer any)
thank you sir/ma'am!
Nikhil B. Singh
Greenhorn
Joined: May 20, 2012
Posts: 18
posted
0
sailaja koney wrote:since its a desktop application and the jar files are in-built.. it should work.
make sure..
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.
String URL = "jdbc:mysql://localhost:3306/test";
String db ="test";
probably, you are mentioning the database name twice....
can be like this..
String URL = "jdbc:mysql://localhost:3306/";
String db ="test";
or
String URL = "jdbc:mysql://localhost:3306/test";
try this
Nikhil B. Singh
Greenhorn
Joined: May 20, 2012
Posts: 18
posted
0
i have inspected very closely the properties of Database connection created by ide. at one place in the property of this connection i found the driver name as MySQL-AB JDBC Driver, while it is listed as MySQL (Connector/ J driver) just above this connection name.
is there any problem by the different name of ab-jdbc driver name.?
Thank you!
Nikhil B. Singh
Greenhorn
Joined: May 20, 2012
Posts: 18
posted
0
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 >
update:
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
no argument
path to start command:
%root%\wamp\bin\mysql\mysql5.5.16\bin\mysqld.exe
without argument
path to stop command:
%root%\wamp\bin\mysql\mysql5.5.16\bin\mysqladmin.exe
argument: -u root stop