Database connection on Java

Database connection on java and access

import java.sql.*;

/**
* Title: Garments
* Description:
* Copyright: Copyright (c) 2008
* Company: Null
* @author Iqbal
* @version 1.0
*/

public class DBManager
{
Statement stmt;
Connection con;

DB MANAGER
public DBManager()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String filename="I:/BCISPP/ICS.mdb";
String database="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";//have to assign space before writing the mdb
database+=filename.trim()+";DriverID=22;READONLY=true}";
con=DriverManager.getConnection(database,"","");
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
}
catch(ClassNotFoundException cnfe)
{
System.out.println("Driver not found:"+cnfe);
}
catch(SQLException sqle)
{
System.out.println("SQL error:"+sqle);
}

}
public ResultSet getRecord(String strSql)throws SQLException
{
return stmt.executeQuery(strSql);
}
public boolean doQuery(String strSql)throws SQLException
{
return stmt.executeUpdate(strSql)>0;
}
public void closeDB()throws SQLException
{
stmt.close();
con.close();
}
TOTAL :
SHIPPING FEE :
GRAND TOTAL :

Thank . We received your oder.

Payment Method
Order ID
Date order
Total

Please make your payment directly via UPI transfer by scaning our below QR codes. Use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.

Please make your payment directly into our bank account. Use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.

Order detail:

Product Name:
Quantity:
Size:
Price:

Customer's detail:

Full name:
Email:
Phone number:
Postcode:
Address:
City:
State:
Country:

Contact Form

Name

Email *

Message *