Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How Do I use a variable for a datasource

Avatar

Level 2

I'm trying to use a variable as a datasource so changes are easy to make with out having to look through the entire process.

If I use SLC_ENGFC_DEV_DS as the literal value the select statement it works. If I create a string variable and set the default value to the same thing I get the error

Exception: Invalid object name 'FLUDDEPT'.

3 Replies

Avatar

Employee Advisor

Here is how I do this :

jdbcTest.jpg                               dataSRC.jpg

Thanks,

Wasil

Avatar

Level 2

I still get:

Exception: Invalid object name 'address'.

Untitled-1.jpg

Untitled-2.jpg

Avatar

Employee Advisor

OK !

I assume you are using sql server, use the query like this :

select * from [database].[schema].[tablename];

Make sure the user (mentioned in Jboss datasource has access(to the database) as well as the required permissions (select, delete etc) for the table object.

e.g.

sqlQuery.jpg

Thanks,

Wasil