How to link dataTable component with Microsoft Access Database?

Please mail me @ [email protected]

Creator might not support MS Access yet but use this code for an access database connection will always work even through notepad or textpad:
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
* @author Mark Hennessy
public class MyDataSource {
private static MyDataSource ds = null;
private static java.sql.Connection connection = null;
/** Creates a new singleton instance of MyDataSource */
private MyDataSource() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = java.sql.DriverManager.getConnection("jdbc:odbc:<db name>", "guest", "guest");
}catch(ClassNotFoundException cnf){
cnf.printStackTrace();
}catch(java.sql.SQLException sqle){
sqle.printStackTrace();
public static DataSource getInstance() {
if(ds == null)
ds = new DataSource();
return ds;
public java.sql.Connection getConnection() {
return this.connection;
public static void closeConnection() {
     try{
          connection.close();
     }catch(java.sql.SQLException sqle){
          sqle.printStackTrace();
plus set up the ODBC connection via click start , click run and then copy and paste the following "odbcad32.exe" without the quotes, click ok, click user DSN tab, click Add...button select Microsoft Access Driver (*.mdb) click finish, give <db name> name of ur access database, give any description <whatever> or leave blank click the select... button navigate to the access database u want to connect to in your java code and select it.
in calling program
public class CustomersImplimentation {
private static java.sql.Connection connection = null;
private java.sql.ResultSet rs = null;
public CustomersImplimentation(){
connection = MyDataSource.getInstance().getConnection();
public Customers[] findAll(){
java.util.ArrayList list = new java.util.ArrayList();
String sql = "SELECT * FROM CUSTOMERS";
try{
java.sql.Statement stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next()){
list.add(new Customers(rs.getInt(1), rs.getString(2), rs.getString(3)));
}catch(java.sql.SQLException sqle) {
System.out.println((new StringBuilder()).append(
"SQLException :: executeQuery Cannot find all Customers:").append(sqle).toString());
Customers[] customers = new Customers[list.size()];
for(int i = 0; i < list.size(); i++){
customers[i] = (Customers)list.get(i);
return customers;
if you have a Customers class created with set and get methods and a constructor that takes an int string string i.e.
public Customers(int ID, String firstName, String lastName){}
then u should be able to run these classes from within creator with an access database. hope this helps?
regards
Henno

Similar Messages

  • How Can I connect to a Microsoft Access Database without using LiveCycle?

    I have Acrobat Professional X. And I need to read a Microsoft Access Database. I don't have LiveCycle Form. Is there any way that I can connect to my database?

    You are in the wrong forum, mate. This is a forum for ColdFusion.

  • How to connect with Microsoft Access Database with JAVA

    I want to know the command and query to connect between MSAccess and JDBC.
    Is it beter way to make connection with MSAccess comparing with other Databases such as SQL and Oracle.
    Which Database will be the best with Java?
    I also want to know to be platform indepadent which database is suitable?

    On Windows, you can use MS Access database by:
    Set up a System Data Source using the ODBC control panel applet.
    Use the jdbc:odbc bridge JDBC driver, and specify a jdbc url that points to the data source name you just specified.
    It's been too long since I've done this, so I don't remember the syntax of the jdbc url, but I'm sure that if you do a search for the jdbc:odbc bridge that you will find what you are looking for.
    As far as the question about which database is best, you will need to determine that based on your project requirements.
    If you want a quick and dirty, open source, cross-platform database, take a look at HyperSonic SQL.
    - K

  • ODBC Cartridge works with MicroSoft Access database?

    I need to work with data saved in the Access Database, I wonder
    if the ODBC Cartridge will work with Access? From the
    documentation, it only mentions Informix, System.... it didn't
    mention Access or Excel ...
    Any suggestion or prior experience to share will be appreciated.
    Your asap response is much appreciated...thanks.
    Frankie
    null

    Hi,
    I'm using OAS407 with ODBC cartridge and connecting to
    Access. Also, Oracle support put an enhancement request
    in for us to modify the ODBC cartridge to return BODY
    tags thru ICX, so ODBC cartridge can be used with
    LiveHTML. Is that what you want to know?
    Regards,
    Mike Thomas
    Frankie (guest) wrote:
    : I need to work with data saved in the Access Database, I
    wonder
    : if the ODBC Cartridge will work with Access? From the
    : documentation, it only mentions Informix, System.... it didn't
    : mention Access or Excel ...
    : Any suggestion or prior experience to share will be
    appreciated.
    : Your asap response is much appreciated...thanks.
    : Frankie
    null

  • How to Connect JSP (Tomcat) with MS access Database

         ^
    Hi all:
    I have been trying to connect JSP using tomcat server with database in MS Access..I have been going through the required steps...but it seems it is a bit complicated...pls help.
    ps: I used to get this message when I run the program:
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:71: Class org.apache.jsp.PreparedStatement not found.
         PreparedStatement sql;
         ^
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:81: Undefined variable or class name: DriverManager
                   dbconn = DriverManager.getConnection(url);
                   ^
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:111: Class org.apache.jsp.SQLException not found.
              catch (SQLException s)

    Hi friends:
    this is the source code, I am working on tomcat server, and it doesn't work at all
    <html>
    <head>
    <%@ page
         import = "java.io.*"
         import = "java.lang.*"
         import = "java.sql.*"
    %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 3</h1>
    <%
         String     place;
         String url = "jdbc:odbc:ferasdb";
         Connection dbconn;
         ResultSet results;
         PreparedStatement sql;
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              try
                   int     latitude,longitude,easting,northing;
                   boolean     doneheading = false;
                   dbconn = DriverManager.getConnection(url);
                   place = request.getParameter("place");
                   sql = dbconn.prepareStatement("SELECT * FROM gazetteer WHERE feature = '" + place + "'");
                   results = sql.executeQuery();
                   while(results.next())
                        if(! doneheading)
                             out.println("<table border=2>");
                             doneheading = true;
    latitude = results.getInt("latitude");
    longitude = results.getInt("longitude");
    easting = results.getInt("easting");
    northing = results.getInt("northing");
                        out.println("<tr><td>" + latitude);
                        out.println("<td>" + longitude);
                        out.println("<td>" + easting);
                        out.println("<td>" + northing);
                   if(doneheading)
                        out.println("</table>");
                   else
                        out.println("No matches for " + place);
              catch (SQLException s)
                   out.println("SQL Error<br>");
         catch (ClassNotFoundException err)
              out.println("Class loading error");
    %>
    </body>
    </html>

  • How to save a picture file into Microsoft Access Database?

    I want to save a picture file,such example.jpg file into a Microsoft Access Database in JSP,anybody know how to save picture file into Microsoft Access Database and read this picture file from Microsoft Access Database and then show this picture in a JSP page?
    Thanks in advance.

    Not posible in case of Microsoft Access ..
    You will hv to use oracle for that ....
    search for Blob / Clob

  • Microsoft access database

    Hello All,
    How can i talk to a microsoft access database from java without being on a windows machine?
    Thanks

    You don't want to.
    MSAccess is not running as a server on the win machine: the machine might not be up all the time....
    Anyway you would need to have the right url / system dsn in the jdbcodbc driver. I do not know if the driver supports the javax.sql.DataSource ....
    So there is enough against you right from the start.
    Can you upsize your MSAccess to MSSQL on a win server ? (or any other DB on a server with the right driver from your target?... could be MYSQL)
    Enjoy

  • How to create user dsn for microsoft access driver(*.mdb,.*accdb) in 64 bit

    hi,
    how to create user dsn for microsodt access driver(*.mdb,*.accdb) using command line in 64 bit.
    i have installed 64 bit drivers and when use following command
    C:\Windows\System32>odbccad.exe CONFIGDSN "Microsoft Access Driver (*.mdb,*.accdb)" "DSN=GLDatabase|Description=GL Data Source|DBQ=C:\DataBase\1.mdb"
    CONFIGDSN:'unable to create a datasource for the "Microsoft Access Driver (*.mdb,*.accdb)" component not found in the registry with the error code -2147467259
    but it works with C:\Windows\SysWow64

    yes i have installed Microsoft Access Database engine 2010 redistributale => AccessDatabaseEngine_x64.exe
    i can able to create user dsn using odbccad32.exe in system32 folder but using command line its not working
    C:\Windows\System32>
    odbccad.exe CONFIGDSN "Microsoft Access Driver (*.mdb,*.accdb)" "DSN=GLDatabase|Description=GL Data Source|DBQ=C:\DataBase\1.mdb"
    CONFIGDSN:'unable to create a datasource for the "Microsoft Access Driver (*.mdb,*.accdb)" component not found in the registry with the error code -2147467259

  • Login codes using java database (validates with Microsoft Access File)

    hi all pro-programmer, can you show me the code to login with the username and password using java database. When the user enters the username and password in the login page then it will go to the requested page. may i know how to do it?

    no one will give you complete code.
    i'll lay out the pieces for you, though:
    (1) start with a User object. give it username and password attributes.
    (2) write a UserDAO interface with CRUD operations for a User object.
    (3) write a UserDAOImpl for your Microsoft Access database
    (4) write an AuthenticationService interface
    (5) write an implementation of the AuthenicationService that works with the UserDAO to authorize a User.
    Use a servlet to accept request from your login page and pass it off to the service. Voila.
    PS - Here's skeleton to start with. UI, servlet, and controller are your responsibility:
    package model;
    public class User implements Serializable
        private String username;
        private String password;
        public User(String u, String p)
            this.username = u;
            this.password = p;
        public String getUsername() { return username; }
        public String getPassword() { return password; }
    public interface UserDAO
        public User findByUsername(String username);
        public void saveOrUpdate(User user);
        public void delete(User user);
    public class UserDAOImpl implements UserDAO
        private Connection connection;
        public UserDAOImpl(Connection connection)
            this.connection = connection;
        public User findByUsername(String username)
            String password = "";
            // logic for querying the database for a User
            return new User(username, password);
        public void saveOrUpdate(User user)
            // save or update a User
        public void delete(User user)
            // delete a User
    public interface AuthenticationService
        public boolean isAuthorized(String username);
    public class AuthenticationServiceImpl implements AuthenticationService
        private UserDAO userDAO;
        public AuthenticationServiceImpl()
            // Create a database connection here and the UserDAO, too.
        public boolean isAuthorized(String username)
            boolean isAuthorized = false;
            // Add logic to do the database query and decide if the username is authorized
            return isAuthorized;       
    }

  • ODBC Cartridge works with MicroSoft Access?

    I need to access data from the MicroSoft Access database. Will
    the ODBC Cartridge work? From the Release Note, it says only
    RDBMS like Sysbase, Informix... it didn't say much on the
    Access database.
    Any suggestion of how to do it will be helpful... Thanks.
    ** I appreciate any reply asap... Thanks.
    Frankie
    null

    Frankie,
    I am not sure what you mean by 'ODBC Cartridge' . In JDeveloper
    (as with the JDK) you would connecto to an ODBC datasource using
    the JDBC-ODBC bridge. This works for MS Access.
    Hope this helps.
    Regards,
    Frankie Lau (guest) wrote:
    : I need to access data from the MicroSoft Access database. Will
    : the ODBC Cartridge work? From the Release Note, it says only
    : RDBMS like Sysbase, Informix... it didn't say much on the
    : Access database.
    : Any suggestion of how to do it will be helpful... Thanks.
    : ** I appreciate any reply asap... Thanks.
    : Frankie
    null

  • How to link BOM Alt with BOM qty

    Hi,
    How to link BOM Alt with BOM qty in a report??
    e.g.
    BOMA, Alt 1
    MatX Qty = 10
    BOMA, Alt 2
    MatX Qty = 15
    How to reach a perticular case, as STPO do not have a field for BOM Alt (i.e. for STLAL)
    Rgds,
    MS.

    Hi,
    STPO does not have BOM alt field.
    So when we see the out put of STPO, all the BOMs with all alternatives are displayed under single BOM number.
    How to identify a perticular BOM alternative to reach a perticular component. (Same component is used in all BOMs)
    Rgds,

  • How do I open a pdf stored in a Microsoft Access database using Visual Basic studios 2012

    Currently I am unable to find a valid method of being able to open a pdf stored in a Microsoft Access database using Visual Basic studios 2012. I've tried displaying the entire database on a form, but when I do this all the other columns show up with
    the correct data besides the one containing the pdf's, it just displays <binary data> in each row down the column. I also tried another method with which you use the database as a dataset and can drag and drop the rows and columns into the form, which
    again works for all the other columns besides the one containing the pdf's but this time I'm unable to interact with the column  at all. 
    Not too sure if this is in the correct place, but any answers or help would be appreciated. Cheers.

    Alex,
    This forum is dedicated to Project and Project Server. You might get better response, if you post to a Visual Basic forum. Here are couple I could find. 
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral%2Cvblanguage&filter=alltypes&sort=lastpostdesc
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • How to link a form with MSC2N

    Hi,
    Somebody know how to link a form with MSC2N.
    I want to complete the characteristic in the classification and after I want to print them with MSC2N;
    Thanks a lot for your help.
    Best regards
    Kari

    I explain you my problem.
    I want to link a form with MSC2N in order to print all the characteristic, and  all the informations of the good issue.
    That's why I want to link a form with MSC2N.
    My customer ask me to ceate a form with these informations and I don't kow how to join the characteristics in MSC2N and the datas which come from MIGO.
    Somebody could help me?
    Thanks a lot
    Kari

  • How can I save test results to microsoft access database?

    How can I save test results to microsoft access database?

    Your best solution is to use the Database Connectivity Toolset. You can view the specifications and prices at the following web site:
    LabVIEW Database Connectivity Toolset
    http://sine.ni.com/apps/we/nioc.vp?cid=6429〈=US
    If you have additional questions about this toolset, you can email us at [email protected]
    Zvezdana S.
    National Instruments

  • How to Link AD user with Apps user

    Hi,
    We are in process of authenticating EBusiness suite users against their Active Directory credentials.
    We did the following:
    1. Import Apps users into OID
    2. Import AD users into OID
    We dont know how to link AD account with EBz account. Are we on right track?
    Please let me know if there is any document which explains the linking process.

    FYI
    I sucessfully authetnicated the AD user in OID against AD password using external auth.
    Do I really need to import ebusiness apps users into OID and then establish a link? Pls help me explain the process.

Maybe you are looking for

  • Profiling the loading and unloading of modules

    Modules appear to be the ideal solution for building complex rich internet applications but first hand experience has also shown me that they can leak memory like nothing else. I've read anything and everything I could find about modules and module l

  • Brand New iMac 24" internal or external hard drive upgrade to 1TB?

    I just purchased a brand new iMac 24" MB325LL with a 320GB hard drive. I currently have 432GB of data on my PC and I would like to upgrade the hard drive to 1TB. I have 2 options and I need your advice: Option #1 » Cost:CDN*$255* Buy a Samsung Spinpo

  • [Athlon64] MSI K8T NEO-V : incompatibility with ATI RADEON 9800 PRO

    Hi, I read all the subjets on this forum about Radeon problems with MSI K8T NEO motherboard.  Most of the peple can't use their graphic card in all situations. My PC is : -MSI K8T NEO-V -AMD-64 3200 -Power : 400W -ATI RADEON 9800 PRO -1 Go DDRAM (2x5

  • How to make the delivery cost changeable after cancellation of GR?

    Create a PO (with Delivery cost), then GR (101) , then cancel the GR (102), but the delivery cost still cannot be modified eventhough the GR has been cancelled - how to make the delivery cost changeable after cancellation of GR?

  • Need Help removing text from an image.

    I am using illustrator Cs3 version.  I have an image of a sun with text in front of it, now I only need the image of the sun to then use in photoshop. How do I remove the text and still have a full-color image of the only the sun? Please Help! (Image