hi fahad, it's good to see post frm u after a long time. yes, mastermind is right..............ur odbc connection way sould b similar. but here i m also giving u a code that does it (database: ms access)
import java.sql.*;
import java.io.*;
public class DatabaseConnection
{
//__________Declare Global Objects________
Connection con;
Statement stmt;
public DatabaseConnection()
{
File f1=new File("myDB.mdb");
try
{
//__________Loading Driver__________
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//__________Creating Connection___________
Connection con= DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};" +"DBQ="+f1.getAbsolutePath()+"","Administrator","");
//_________Creating Statement___________
stmt=conOthers.createStatement();
}catch(ClassNotFoundException cnfe){System.out.println("Class Not Found Error!!!");}
catch(SQLException sqle){ System.out.println("SQL Exception found!");}
}//End of constructor
}//End of class DatabaseConnection
in fact, this class file solve two prob:
1. connecting to ur db
2. connecting to a db that is in ur working folder
let me know if it doesn't solve ur prob
_________________
we've lot of things to think abt curr probs
so, i don't have time to think abt religion or wonder of sceice .......... how ppl can waste their time like this?