Mohammed Ali

Greenhorn
+ Follow
since Feb 02, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mohammed Ali

Michael
When u register a driver like u did, can we use this driver later on. ie can we call/use drvMySql?
Thanks
Thanks 4 letting me know David.
[ February 03, 2003: Message edited by: Mohammed Ali ]

Originally posted by David O'Meara:

actually, we tend to place a wrapper on the DB operations so that the Business layer is not responsible for any DB operations. You ask for data and either get it or don't get it)
Dave


Great info guys, David can you tell me more about placing wrapper on DB operation..
Thanks!
G'day
Well what I would do is
1- Learn how to setup an ODBC that points to a Microsoft Access database
Check this website(first half of it)
ODBC setting
2- Go back to you JSP
The URL speifying how to connect to Microsoft ODBC database using JDBC
2-1 Load the driver to connect to the database
// some java code
// the unhappy face is simply : followed by O
// I assumed that u named the OBDC as AmandaODBC
String url = "JDBC DBC:AmandaODBC";
// the name and password u used when u created the ODBC
String password ="youpassword";
String username ="youname";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConnection = DriverManager.getConnection(url,username, password);
} catch( ClassNotFoundException cnfex) {
// some error messages here
System.err.println("Failed to conenct to JDBC/ODBC driver")
System.exit(1); // terminates the program
}
The rest should be normal JDBC code, u used the myconnection object to creat statement and use resultset to use the statement...........
Hope that helps...

[ February 02, 2003: Message edited by: Aussie man ]
[ February 02, 2003: Message edited by: Aussie man ]