Create or delete a J2C alias in WebSphere

Home > Search
  by

Before creating a J2C, you will probably want to create the data source.

  1. Select your data source.
  2. Select JAAS - J2C authentication data.
  3. Select New.
  4. Give the J2C alias a name, provide the username and password to connect to the database, and select OK.

 

  1. Select Save.
  2. Select your data source.
  3. In the Component-managed authentication alias, select the J2C alias you just created and select OK.

 

  1. Select Save.
  2. Restart the application server and/or deployment manager.
  3. Check the data source and select Test connection. You must have the Administrator or Operator role to be able to test conection. If the connection is successful, the following message should be displayed.

 

Likewise, when an application that is configured to use JDBC to make a database connection, the application should be able to connect to the database. For example, let's say there is a Java app that contains the following markup to connect to a MySQL database.

Connection conn = DriverManager.getConnection("jdbc:mysql://www.example.com:3306/database_name","username","password");

 

When the app resides on WebSphere, the app will know to use the MySQL data source when connecting to the database. In this example, the application is able to connect to the database.

 


Delete data source

  1. In the left panel of the WebSphere web console, expand Resources > JDBC.
  2. Select Data sources.
  3. Select your data source.
  4. Select JAAS – J2C authentication data.
  5. Check mark the J2C Alias and select Delete.
  6. Select Save.

 

This can also be done via the wsadmin command.

AdminTask.deleteAuthDataEntry('[-alias your_j2c_alias_name ]')

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments