Ahoy!
This post will explain how to connect MySQL to your application Java .
(The IDE used was NetBeans 7.0.1)
First of all, you need to certificate if you have the correct library for this; here, I will use the J Connector(JDBC); for check if you have or not this library:
Right Click on "Libraries" in a project that you already created, click "Add Library", and search for "mysql jdbc driver" or something that looks like this.
Don't have the library? Just go here, and download it.
After the download ends, repeat the previous steps but instead of click "Add Library", click "Add JAR/Folder" and then select the file that you downloaded
And now, a simple code for connection:
Nenhum comentário:
Postar um comentário