on 07-09-2008 12:19 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.