Topic
  • 7 replies
  • Latest Post - ‏2011-11-08T03:51:15Z by zabalex
tsuyodat
tsuyodat
7 Posts

Pinned topic How to get DB profile(connection name/userid/password)

‏2011-08-02T05:10:36Z |
Hi guys.

Thank you for replying another question the other day.

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=378611&tstart=0

Now I develop plug-in by using plug-in API(Mashup V2.0).
I have finished max & statIndex of feed generation Function as bellow.

https://xxx.xxx.xxxxcom:9443/mashuphub/client/plugin/generate/entryid/1424/pluginid/15?startIndex=5&Max=10

But I can't get DB profile(connection name/user id/password).
Now I get DB profile from property file.
I would like to get DB profile by using API.
What plug-in API should I use? Please let me know.
Thanks and best regards.
Updated on 2011-11-08T03:51:15Z at 2011-11-08T03:51:15Z by zabalex
  • drdamour
    drdamour
    52 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-08T13:39:15Z  
    This is an interesting question, and i'd like to hear the answer, but may i make a suggestion.

    Use a WAS managed JDBC source instead of a Mashup Center managed source. They perform way better, and are a much more standard method of configuring DB connection. then you can just get a handle to it doing the normal JNDI stuff.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
  • toskumar
    toskumar
    3 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-09T04:58:56Z  
    To get a list of DB connection profiles available to the user, IDBConnectionService.getAvailableConnectionsForUser() will return all db connections that the user can access.
    
    IDBConnectionService connService = (IDBConnectionService)context.getService(IDBConnectionService.class); List conns = connService.getAvailableConnectionsForUser();
    
  • tsuyodat
    tsuyodat
    7 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-19T02:58:11Z  
    • toskumar
    • ‏2011-08-09T04:58:56Z
    To get a list of DB connection profiles available to the user, IDBConnectionService.getAvailableConnectionsForUser() will return all db connections that the user can access.
    <pre class="jive-pre"> IDBConnectionService connService = (IDBConnectionService)context.getService(IDBConnectionService.class); List conns = connService.getAvailableConnectionsForUser(); </pre>
    Hi toskumar

    Thank you for your answer.
    I have one question.
    I want to use IDBConnectionService.getAvailableConnectionsForUser method,but I don't Know what package I should import when compiling.
    Please let me know.

    Best reagrds.
  • toskumar
    toskumar
    3 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-19T05:25:40Z  
    • tsuyodat
    • ‏2011-08-19T02:58:11Z
    Hi toskumar

    Thank you for your answer.
    I have one question.
    I want to use IDBConnectionService.getAvailableConnectionsForUser method,but I don't Know what package I should import when compiling.
    Please let me know.

    Best reagrds.
    IDBConnectionService class is under package com.ibm.mashuphub.core.service, set mhubapi.jar in your classpath to compile custom plugin, this jar contains all necessary api for writing plugins.

    C:\Program Files\IBM\Mashup Center\3.0\Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\client\api\mhubapi.jar

    /opt/IBM/MashupCenter/3.0/Hub/installedApps/Mashup\ Hub.ear/mashuphub-enterprise.war/client/api/mhubapi.jar

    -Senthil
  • tsuyodat
    tsuyodat
    7 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-27T05:29:33Z  
    • toskumar
    • ‏2011-08-19T05:25:40Z
    IDBConnectionService class is under package com.ibm.mashuphub.core.service, set mhubapi.jar in your classpath to compile custom plugin, this jar contains all necessary api for writing plugins.

    C:\Program Files\IBM\Mashup Center\3.0\Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\client\api\mhubapi.jar

    /opt/IBM/MashupCenter/3.0/Hub/installedApps/Mashup\ Hub.ear/mashuphub-enterprise.war/client/api/mhubapi.jar

    -Senthil
    Thank you torkmar.

    I could get db profile using above method on Mashup V2.0

    I want to use this method in JSP, but I can't get "context" from "request".
    Please let me know to get "context".

    And I have one more question.
    When feed entry is registered, I want to set sql parameter in feed url which is displayed on feed catalog detail like bellow.
    I investigate how to set,but I can't find method.

    select lot_id from lot where state=':state' and bank_id=':bank_id'

    https://xxx.ibm.com:9443/mashuphub/client/plugin/generate/entryid/4653/pluginid/227656?state=&bank_id=

    Now default feed url is bellow.

    https://xxx.ibm.com:9443/mashuphub/client/plugin/generate/entryid/4653/pluginid/227656?

    Best regards.
  • tsuyodat
    tsuyodat
    7 Posts

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-08-27T05:39:04Z  
    • toskumar
    • ‏2011-08-19T05:25:40Z
    IDBConnectionService class is under package com.ibm.mashuphub.core.service, set mhubapi.jar in your classpath to compile custom plugin, this jar contains all necessary api for writing plugins.

    C:\Program Files\IBM\Mashup Center\3.0\Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\client\api\mhubapi.jar

    /opt/IBM/MashupCenter/3.0/Hub/installedApps/Mashup\ Hub.ear/mashuphub-enterprise.war/client/api/mhubapi.jar

    -Senthil
    Thank you toskumar .

    I could get db profile using above method on Mashup V2.0

    I want to use this method in JSP, but I can't get "context" from "request".
    Please let me know to get "context".

    And I have one more question.
    When feed entry is registered, I want to set sql parameter in feed url which is displayed on feed catalog detail like bellow.
    I investigate how to set,but I can't find method.

    select lot_id from lot where state=':state' and bank_id=':bank_id'

    https://xxx.ibm.com:9443/mashuphub/client/plugin/generate/entryid/4653/pluginid/227656?state=&bank_id=

    Now default feed url is bellow.

    https://xxx.ibm.com:9443/mashuphub/client/plugin/generate/entryid/4653/pluginid/227656?

    Best regards.
  • zabalex
    zabalex
    1 Post

    Re: How to get DB profile(connection name/userid/password)

    ‏2011-11-08T03:51:15Z  
    Hello,

    I'm sorry as my question may sound a bit silly, but what CMS is ibm.com using? It doesn't look like vBulletin, and it doesn't look like Joomla or WordPress.
    Please, let me know. If it were Joomla, I might be able to help you, but since it is not, I'm just curious.

    Thank you,

    SEO San Francisco | website design | Alicka Website Design