How to connect netbeans 6.8 to sql server 2008?
I want to use databases created in sql server in netbeans , i am bit confuse in the process their are many programs and stored procedures found on sites but i could not found step by step procedure for set connection. i want every step where to write code and procedures for connection , anyone please help me .
Dipankar BiswasPosted May 12, 2015, 8:44 AM
Check This Video link..
https://www.youtube.com/watch?v=pBH9MUKuzME
Gopi ChandPosted May 12, 2015, 9:16 AM
First you have to install the setup of mysql by checking the boxes of your uses and also by fill username & password.
After then you have to make a java file for making connection between netbeans and mysql.
The code for connection is here.
import java.sql.*;
public class connect{
public Connection c() throws Exception
{
Class.forName("com.mysql.jdbc.Driver");
Connection connect=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "toor");
return connect;
}
}
3306 is a port number, "root" is username, "toor" is password, mydb is the name of database created in mysql after installing the setup of mysql.
For connection, you also need a rar file that should added in the library of your project package. The rar file is attached here.
For any query, please welcome again.
Thank you.