cancel
Showing results for 
Search instead for 
Did you mean: 

Hard code username & password for system

Former Member
0 Kudos

Hi All,

I'm using this piece of code to connect to the back-end via a defined system (with alias='CN')

try {
	con = cgservice.getConnection("CN", cp);
	}
	catch (Exception e)
 {
			   e.printStackTrace();
  }

Is there a way I can hard code the username and password in this code instead of doing user-mapping on the portal?

Please help..urgent!

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi D.V.,

If you want all the users to connect using the same credentials, the 'correct' way would be to create one user mapping to the group 'everyone', and not hardcode the username and password.

You can also use a specific user instead of the logged on one when creating the ConnectionProperties.

To get an authenticated user see:

/thread/62774 [original link is broken]

and:

These are your options using JCA.

There are also ways to connect to the system using explicit credentials, which depends on the system type (SAP - use JCO, JDBC - use java.sql.DriverManager).

Hope that helps,

Yoav.