• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdbc advanced

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can i connect directly to msaccess database .if yes how
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are a whole bunch of replies like this, but here is one http://www.javaranch.com/ubb/Forum3/HTML/001275.html
Dave
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
u must create ODBC DSN
java sample
import java.sql.*;
String url="jdbc dbc:yourodbcdsn";
int Recordcount=0;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection access=DriverManager.getConnection(url,"Admin","");
Statement st=access.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
String Query="select * from table1";
ResultSet Result=st.executeQuery(Query);
Result.last();
RecordCount=Result.getRow();
Ssytem.out.println(RecordCount);
Result.close();
st.close();
access.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic