Maurizio Cucchiara
Maurizio Cucchiara

Reputation: 895

Java integration from MDB to WebApp

Our customer has a client/server application based on mdb database (microsoft access) and he'd like to expose part of data via his web site (deployed in java). What is the best way to achieve it? I need a place to start (for example web service, spring integration, mule, service mix).

Upvotes: 0

Views: 892

Answers (3)

AlexR
AlexR

Reputation: 115378

I believe that you are a little bit disappointed. MDB is Message Driven Bean. It is not database. It is a way to listen to JMS destination and perform some action driven by JMS messages. The data already must be saved somewhere in DB. If they use MDB it is a Java EE application.

Now about the site. Which technologies are used for site? If it is java based technologies your life is easier because the site is a Java EE application too. In this case you actually have 2 Java EE applications. If all these correct you can

  1. merge them. In this case you can just call the "mdb based application" from the back end of the web site.
  2. Alternatively you can call one application from another. Perform remote EJB call or expose some of the API as a web service and call it. Or even connect to the queue of "mdb application" from site and send messages.

If site is not written in Java use web services or connect to queue.

Generally you have a lot of possibilities. But it is hard to recommend something specific without additional details. I hope that this answer helped you a little bit. If you need more help please provided details.

Upvotes: 0

Albert D. Kallal
Albert D. Kallal

Reputation: 49169

If the web server is currently located on your office LAN, and the access front end applications can use/see the folder where the back end mdb file resides (we're talking windows networking here), then in theory you could expose some of this data to the web server if web server loads and usage rates are not going to be too high.

In the case that the server is not going to be on the same Office Network, then an often used an reasonable solution is to simply move the back end data out of access and move it into some database server such as SQL server, or mySQL. When you do this, then both the access application (front end part) thus continue to run and function as before. And now also the web site can also share that data. This so called upsizing process of access data is not hard to do, but you want a competent access developer that knows both SQL server and access, and has done upsize many times. If the developer done this many times then it not a lot of work in most cases to move the data out to a server and keep the existing code investment.

So your choices are to keep the access code and database as is, but simply move the data out of access to a server based system. As noted the other alternative is in the case that if your web server is attached to the same network where access data resides, then in theory would be a simple matter to place the access backend data on the same server as the web server. This setup would allow both the locally users on the Office Network, and the web server to share and utilize the data in the access backend file.

Another alternative is of course is to have access to connect to a database server your utilizing on the web system, such as MySQL of SQL server. Since access can connect to the database server in this fashion, then again it is theory possible to shuffle data at predetermined times, or even during use to pull data down that's been gathered from the web site into the access application. So you keep Access as is, but connect it to the web part that gathers needed data.

Which of the alternative above choices above makes sense will depend on your particular set of circumstances.

To really throw a wrench into this mix, access for 2010 can build scalable cloud computing systems where the data is based either on Azure SQL or even 100% web based if you have SharePoint. In fact when you publish an access database to sharepoint now the result is .net XAML (zammel) forms and a scalable system in terms of users. In the following video you'll say that the halfway point I switch to running the access application entirely in a browser:

http://www.youtube.com/watch?v=AU4mH0jPntI

To do the above access web development, you'll be using SharePoint. However, if your organization does have SharePoint now then this could be a reasonable possibility for you.

Upvotes: 2

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181350

You can connect to your ACCESS database with Java through JDBC-ODBC Bridge.

The steps to do this would be:

  1. In your server (the one hosting your Java Web Application) create an ODBC entry pointing to your ACCESS file. Name it mdbodbcaccess.
  2. Then connect to that ODBC entry from Java using JDBC.

Something like this:

//
// points to the entry you've just created
//
Connection conn = DriverManager.getConnection("jdbc:odbc:mdbodbcaccess"); 
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select f1, f2 from table");
while (rs.next()) {
    // iterate your resultset and do something with it
    System.out.println(rs.getString("f1"));
}
rs.close();
st.close();
conn.close();

Alternatively, you might want to use pooled connections from your Application Server.

Upvotes: 0

Related Questions