can't write my jdbc class to manipulate mysql
well, i recently installed netbeans 6.8 .
from netbeans i can access and manipulate mysql 5.0 databse.
from netbeans i could even manage to generate an entity class.
but when i try to write a little datahelper class to manipulate my database..
i cant get this jdbc working.
my jdbc jar folder is placed in the lib folder
i just typed the following line to see whther everything is working fine. Class.forName("com.mysql.jdbc.Driver");
but this line doesn't get recognise by netbeans..
am i doing something wrong..
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DAO;
import java.util.*;
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author dilanka
*/
public class DataHelper{
//Connection conn = null;
//String userName ="root";
//String password = "dilan";
//String url = "jdbc:mysql://localhost:3306/bidbizz";
// DataHelper(){}
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection (url, userName, password);
}
i am a new member to this forum.. plz just help me..