plz give me one example and how to generate Driver of data base
Recommended Answers
Jump to PostDatabase drivers (jdbc,odbc,.net...) are provided by database vendors or third party vendors and not generated. JDBC drivers are loaded into the JVM at runtime.
Please refer some books on JDBC Connectivity
Jump to Postto connect ms access with java
you have to datasource nameand write this code in ur 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
}
All 8 Replies
zandiago
115
Nearly a Posting Maven
Featured Poster
lookof2day
6
Junior Poster in Training
muthulakshmil
0
Newbie Poster
7arouf
0
Light Poster
varunnanda
0
Newbie Poster
varunnanda
0
Newbie Poster
SNK111
0
Newbie Poster
varunnanda
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.