Hi to everyone,
How to create access database for bills?
I am still in the planning process and was not able to figure out the proper way of connecting Java applications to ms access database.
Do you have some tips regarding this matter?
Your suggestion is very much welcome.
How to create access database for bills?
Dear user,
To connect Java applications to ms access database, what you need to do is to go to Control Panel and then click administrative tools, now select your driver and database.
You can use database drivers like JDBC, ODBC, etc. To connect ms access with Java, write this code in your program:
Connection con=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:DSNÂ name");
Statement stmt=con.createStatment();
ResultSet rs=stmt.executeQuery("select * from tablename");
while(rs.next())
{
System.out.println(rs.getSting("username"); //here username is the field name
}
Hope this will help you.
Thank you.