Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java database connectivity...  RSS feed

 
sanju gajera
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!! this is sanjay gajera
i want to know that how to connect the java applicaation to the database ....Access...please tell me this solution with exampale of small database ACCESS based application...as soon as possible.....
thanks....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65973
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
Milankumar Desai
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public void getConnection() {
try {
java.sql.Connection con = null;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("sun.jdbc.odbc.JdbcOdbcDriver found");
con = DriverManager.getConnection("jdbcdbc:CtsEmployee", "", "");
} catch (Exception cnfe) {
System.out.println("Error: sun.jdbc.odbc.JdbcOdbcDriver not found");
}
}

This is some snippet of code for access connection where CtsEmployee is some dataourse
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!