How to create access database for bills?

Asked By 20 points N/A Posted on -
qa-featured

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.

SHARE
Answered By 0 points N/A #172663

How to create access database for bills?

qa-featured

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.

Login/Register to Answer

Related Questions