Need Help in NetBeans connectivity with MSAccess 2003 !!!! urgently

Status
Not open for further replies.

047

Broken In
Hi guys...

can anyone please help me in NetBeans 6.8 connecting with MSAccess 2003?

i m using following code to setup a connection...

"
public static void main(String args[])
{
String myDriverName="sun.jdbc.odbc.JdbcOdbcDriver";
String url="jdbc: odbc:samdatabase";

try
{
Class.forName(myDriverName);
}

catch(ClassNotFoundException e)
{
System.err.println("Class not found");
return;
}

try
{
Connection con=DriverManager.getConnection(url);
System.out.println("Connection established successfully");
}

catch(Exception e)
{
System.err.println("Connection did not establish successfully");
}
}

"


please help me out in connecting to MSAccess......

one more thing....if i want to use this in a swing form..how to display an error message to the user?
like we do in Visual Studio 2005 using "messageBox()". is there anything which can display messagebox in netbeans 6.8.....
 
Status
Not open for further replies.
Top Bottom