Skip to Content
Former Member
Jan 21, 2008 at 01:05 AM

Where do i place these database connection codes.. Points awarded!!


Hi, i have actually posted to ask regarding database connections from my database MS SQL 2005 to my adobo form..

The thing is this, i need to have a database connection to my database which is MS SQL 2005 so that my Interactive form can retrieve data from the database to pre-fill the form when someone downloads my form..

The below code is given to me but i do not quite understand it, can someone explain to me where do i put them, how do i create a class and how to do it? Or is there another way u all know of?

Points awarded for any help at all!!

Thanks In Advance..


Hi Jing xuan,

it is just pure java programing.

you can create a class with following code.

InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/ADSTAT_RO");

Connection adstatCon = ds.getConnection();

adstatCon .prepareStatement("YOUR SQL");

after you retrieved the data, you can store them in context which will be bind to your form. so your form will be populated.

Best regards,