Skip to main content

Hi,

I am trying to access from java. I added jar files to libraries. I am getting null pointer exception. What is the problem? 

package javaapplication1;

import ifs.fnd.ap.*;

public class JavaApplication1 {
public static void main(Stringg] args) {
try {
Server srv = new Server();
srv.setConnectionString("jdbc:oracle:thin:@//192.168.x.xxx.1521/TEST");
srv.setCredentials("ifsapp", "******");
System.out.println();
PlsqlSelectCommand selCmd = new PlsqlSelectCommand(srv, "SELECT IDENTITY, DESCRIPTION FROM FND_USER");
RecordCollection result = selCmd.executeQuery();
System.out.println("All users:");
if (result != null && result.size() > 0) {
RecordIterator itr = result.recordIterator();
Record next;
while (itr.hasNext()) {
next = itr.nextRecord();
System.out.println(" " + next.findValue("IDENTITY") + "\t" + next.findValue("DESCRIPTION"));
}
} else {
System.out.println("No rows selected");
}
} catch (Exception err) {
err.printStackTrace(System.out);
}
}
}

 

 

Hi @hhy38 ,

 

You’ve used the JDBC connection string format which I think is the problem. Change it to

srv.setConnectionString(IFS_URL:PORT)

Java Access Provider connects to IFS through IFS middleware server. Therefore yo need to use the IFS url, not the database connection string.

 

Happy coding!

Damith

 


Hi @hhy38 ,

 

You’ve used the JDBC connection string format which I think is the problem. Change it to

srv.setConnectionString(IFS_URL:PORT)

Java Access Provider connects to IFS through IFS middleware server. Therefore yo need to use the IFS url, not the database connection string.

 

Happy coding!

Damith

 

Thank you. The problem has been solved.