Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Connecting to DB2 in classic ASP application

Posted on 2013-01-17
4
Medium Priority
?
1,228 Views
Last Modified: 2013-01-23
Please forgive me if this is a remedial question.  I'm a java developer who has been asked to enhance a classic ASP application to interact with a DB2 database running on an AS400.  I've already asked and they don't want the app converted to .NET or Java.

To the best of my knowledge the server that this app is currently running on does not have the DB2 drivers installed on it.  I honestly don't know if I can get them to be installed.  So my main question is - is it possible to connect to DB2 from a classic ASP app if these drivers are not installed on the host server?  If it is possible how would I construct the connection string?

Any help is appreciated.  Thanks.
0
Comment
Question by:mb1969
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 501 total points
ID: 38788210
Hi mb,

You should be able to connect to the database from your application, but the application will need to "do all the work".  You can connect, fetch data, store/replace data, etc, but the application will need to send all of the correct SQL.  To prevent SQL injection, it's highly recommended that you implement stored procedures on the database server to do most of the work.

The first thing is to get the connection string right.

  http://connectionstrings.com/as-400

That page contains an outline of the things that you'll need to satisfy for the requirements to connect to the AW/400.  It also has a lot of examples.


Kent
0
 
LVL 8

Assisted Solution

by:mustaccio
mustaccio earned 501 total points
ID: 38788469
You will need to install the DB2 Data Server Client (or at least ODBC drivers), as the use of the Microsoft driver for DB2 is not recommended, as well as the software called DB2 Connect that acts as a gateway between ODBC requests and the protocol that AS/400 understands. The client is free, DB2 Connect you (or "they") will have to buy.

With Java, you can use the DB2 JDBC driver to connect to the database directly without the DB2 Connect gateway.
0
 

Author Comment

by:mb1969
ID: 38788681
Yeah that's what I was afraid of.  I'd really rather re-write the app in Java because then I don't care what kind of machine it runs on.  Maybe if I convince them I can't do this without having additional software installed on the current host server that will change their minds.
0
 
LVL 27

Accepted Solution

by:
tliotta earned 498 total points
ID: 38795828
I've known of others who have only used ODBC drivers provided by MS to access DB2 on AS/400s. But when problems arise, the actual IBM-supplied drivers usually resolve things.

There is no need for DB2 Connect nor any chargeable software item.

However, if there really is an issue with installing drivers, it's hard to imagine a good way to achieve assured  success. You can obtain the specs for remote database access from IBM. You should then also expect to spend a few months doing the programming necessary to communicate with a remote database server outside of drivers.

It makes practically no sense to be asked to access to some vendor's database server and then restrict installation of drivers. They're free, so there shouldn't be a problem.

BTW, you'd perhaps be better off with OLEDB or other drivers than with ODBC, but that's a separate question.

Tom
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question