on 10-08-2009 5:17 AM
Hi All,
Please help me resolve this error while using a JDBC Lookup while writing a UDF for it. It is giving an authorization error. while trying to Display Queue on the UDF written.
The code is like:
DataBaseAccessor accessor = null;
DataBaseResult JDBCOutPayload = null;
String BusinessSystem="clarify_dev_bizsys";
//give your business system having channel name
String CommunicationChannel="JDBC_TO_CDEV";
//give your channel name
String InputPayload= " select X_TXN_PRE_SITE_XFACE.nextval from dual;";
//give your sql query
try {
Channel channel =
LookupService.getChannel(BusinessSystem,CommunicationChannel);
accessor = LookupService.getDataBaseAccessor(channel);
DataBaseResult resultSet = accessor.execute(InputPayload);
for(Iterator rows = resultSet.getRows();rows.hasNext();)
{
Map rowMap = (Map)rows.next();
}
}
catch (Exception e) {}
finally {
if (accessor != null)
accessor.close();
}
OBJID.addValue("OBJID");
The errors are "User has no Authorization". and "/usr/sap/XIX/DVEBMGS03/j2ee/cluster/server0/./temp/classpath_resolver/Map4fdb99c0b3c311de8ec7001560de7906/source/com/sap/xi/tf/_MM_CLARIFY_MODELS_.java:139: unreported exception com.sap.aii.mapping.lookup.LookupException; must be caught or declared to be thrown accessor.close();"
I've imported both com.sap.aii.mapping.lookup.;java.util.;
Is there any parameter where we can give the User ID & Password for accessing the database table which I've missed. As I've already given the USERID & Password in the Communication Channel.
Thanks in Advance,
Sreedhar.
Edited by: Sreedhar Av on Oct 8, 2009 6:29 AM
Opened a new thread for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer this blog:
I think you need some optimization of your code
Regards
suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
accessor.close();
this method has to be written in a try block because it throws an LookUpException and catch the exception in catch block then you dont get the error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I've modified my code like this
DataBaseAccessor accessor = null;
DataBaseResult JDBCOutPayload = null;
String BusinessSystem="clarify_dev_bizsys";
//give your business system having channel name
String CommunicationChannel="JDBC_TO_CDEV";
//give your channel name
String InputPayload= " SELECT X_TXN_PRE_SITE_XFACE.nextval from dual;";
//give your sql query
try {
Channel channel = LookupService.getChannel("BusinessSystem","CommunicationChannel");
accessor = LookupService.getDataBaseAccessor(channel);
DataBaseResult resultSet = accessor.execute(InputPayload);
for(Iterator rows = resultSet.getRows();rows.hasNext();)
{
Map rowMap = (Map)rows.next();
}
OBJID.addValue("OBJID");
}
catch (Exception e) {}
result.addValue(e.getMessage()) ;
finally {
try{
if (accessor != null) accessor.close();
}
catch(Exception e)
{
OBJID.addValue(e.getMessage()) ;
}
Correct me if I'm wrong anywhere.
Now it is giving an error:
"/usr/sap/XIX/DVEBMGS03/j2ee/cluster/server0/./temp/classpath_resolver/Map3fb95c30b3d211de98da001560de7906/source/com/sap/xi/tf/_MM_CLARIFY_MODELS_.java:138: 'finally' without 'try' finally {"
Thanks in Advance.
Sreedhar.
Edited by: Sreedhar Av on Oct 8, 2009 8:15 AM
Hi,
I've changed the USERID & Password, authorization error is resolved but now it is giving the error:
usr/sap/XIX/DVEBMGS03/j2ee/cluster/server0/./temp/classpath_resolver/Mapcab44fb0b3c411deb8c0001560de7906/source/com/sap/xi/tf/_MM_CLARIFY_MODELS_.java:138: unreported exception com.sap.aii.mapping.lookup.LookupException; must be caught or declared to be thrown accessor.close();
How do rectify this?
Sreedhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You dont have authorization to access the data from DATA BASE,You mention use name password in communication channel,but the user doesnot have acces permission.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
I've changed the USERID & Password but now it is giving the error:
usr/sap/XIX/DVEBMGS03/j2ee/cluster/server0/./temp/classpath_resolver/Mapcab44fb0b3c411deb8c0001560de7906/source/com/sap/xi/tf/_MM_CLARIFY_MODELS_.java:138: unreported exception com.sap.aii.mapping.lookup.LookupException; must be caught or declared to be thrown accessor.close();
How do rectify this?
Sreedhar.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.