cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to connect Database Using Data Source Name in SAP PI

Former Member
0 Kudos

Hi PI Experts,

I am facing a problem to connect to Database from UDF/ Java Mapping using Data Source Name.

I have created one data source name in Netweaver Administrator and updated all the configuration details like URL of the database server and properties(username & password) for creating connection to the Database.

I am using this data source name in my UDF to connect database. But i am getting below errors like

Error Description:1     Object not found in the lokkup.

after doing small changes in my lookup i got the below error

Error Description:2     Caused by: ORA-00942: table or view does not exist OpenSQLExceptionCategories: [NON_TRANSIENT, DB_OBJECT_UNKNOWN

But table already exist and using in other scenario. There is no issue with Table.

This is the program that i am using: In this program i am sending Data source name and sqlStmt values as a parametrs from my UDF.

ds = (DataSource)ctx.lookup(s);

  if (ds == null)

  {

  value = "Error - No dataSource: " + dataSource;

  return value;              

  }

  }       

  catch (Exception e)

  { 

  value = e.getMessage();

  return value+"Context Lookup";         

  }  

  try

  {                  

  conn = ds.getConnection();    

  //trace.addInfo("Connected");

  if (conn != null)

  {

  stmt = conn.createStatement();  

  rst = stmt.executeQuery(sqlStmt); 

  if (rst.next())

  {            

  value = rst.getString(1);

  }                        

  conn.close();           

  }      

Can any one help me on this...............................

Thanks In Advance.




Regards,

Srikanth Mavuri.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Any Updates on this... ?