This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc advanced

 
joseph jacob
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i connect directly to msaccess database .if yes how
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Dorj Galaa
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • 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());
}
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic