DOWNLOAD

Get our toolbar!

Saturday, 30 April 2011

// write a program of JDBC ODBC connectivity through ms access which prints the record one by one.


CODE

import java.sql.*;
class Database
{
public static void main(String args[])throws
Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:nitin");
Statement st=con.createStatement();
ResultSet res=st.executeQuery("select * from Student");
while(res.next())
{
System.out.println(res.getInt(1)+" "+res.getString(2)+" "+res.getString(3)+" "+res.getString(4));
}
}
}

OUTPUT DISPLAY










0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More