cancel
Showing results for 
Search instead for 
Did you mean: 

java dictionary database table in web dynpro application

Former Member
0 Kudos

Hi,

I want to access java dictionary database table in my web dynpro application in java.

Right now I have created one java dictionary DC.

and in that Dc i have created two database table .

Now I want to use this table in my web dynpro application.

Can anyone help me.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

You can use the Dictionary Projects to create tables in Database. You must use codes to access these database tables that is created using Dictionary projects.

You have to use the DataSource in order to get connection ; Use Visual Administrator to see the data source name.

You can use the following code to access the database table.

ResultSet result = null;

try

{

InitialContext initialcontext = new InitialContext();

DataSource datasource = (DataSource)initialcontext.lookup("jdbc/<DataSourceName>");

Connection connection = datasource.getConnection();

Statement statement = connection.createStatement();

result = statement.executeQuery( <Query>);

connection.close();

} catch (NamingException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Regards

Vinod

Former Member
0 Kudos

Hi,

Deploying of a java dictioary, creates the table in database. generally portaldb would be maxdb.

Use the [JDBC programming|http://www.mysql.com/sap] to connect with maxdb by using [datasource|http://dev.mysql.com/doc/maxdb/en/84/1d733cefd63c38e10000000a114084/content.htm].

otherwise you can develope ejb to connect with table and use that [EJB in webdynpro|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c]