cancel
Showing results for 
Search instead for 
Did you mean: 

adding values to the fields for Dictionary table

Former Member
0 Kudos

Can somebody tell me as to how do we add values for the fields that we made in the Dictionary table in the dictionary perspective for a webdynpro application

I want my Initial view to have a table with some values for the columns already present--means the table should not appear empty

Plz tell me hoew to add values for the columns here?

Thanx

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I hope you want to insert values to table that you created using Dictionary Project.. Using the Dictionary project, you can create tables; but in order to populate Database table with values, you must follow the code that i described below; or use any Database interface, that gives an easy to use interface to insert values.

Use the following code to insert values to table

InitialContext initialcontext;

try {

initialcontext = new InitialContext();

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

Connection connection = datasource.getConnection();

Statement statement = connection.createStatement();

statement.executeUpdate( Query);

connection.close();

} catch (NamingException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Use the insert sql statement in order to insert value to table.

The syntax of insert query will be


insert into tablename ( fields....) values (values...)

Regards

Vinod

Edited by: Vinod V on Jul 9, 2008 5:30 PM