on 2005 Aug 03 5:43 AM
hi all
Is it possible to write ddl statements of sql in web dynpro.
i wish to create table from dynpro.
bye
Hi ,
One more way !!
1. I have created the tables using the Dictonary project
in MaxDB
I have imported the tables as Models in WebDynpro using
JavaBean importer.
I wrote a simple generator that will generate a simplebean out the tables in webdympro. (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf)
Note : There are some limitations in the tool
2.Another way is write all your SQL statements in the component/custom controller (JDBC programming) and access those methods from the view .
Regards, Anilkumar
Message was edited by: Anilkumar Vippagunta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mitesh,
Adding to Ghosh's comment the best way I suggest you to do is create your table manually using Dictionary for MaxDB or in any other Vendor SQL manually.
Use the corresponding vendor driver file to connect to the DB.Try DML statement alone from your Webdynpro fo contacting and querying your DB.
The reason why DDL is not suggested from Webdynpro is that the Webdynpro meta model user interface does not by itself supports effective DDL statement like we normally do in .jsp file. or javafile.
Hence the performance is also affected if you have DDL in WD.
Hope it helps.
Regards,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mitesh,
Its not possible to use DDL statements in Webdynpro.
You can only use DML statements in webdynpro or any other J2ee applications.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mitesh,
Try this link on relational persistance
http://help.sap.com/saphelp_nw04/helpdata/en/bd/b127af68234e868cfd4e9f440aa0bf/frameset.htm
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you should not use DDL or DML directly from WebDynpro ever, as the WD framework is meant only for User Interface creation. You should envelope your Business Processing logic in some EJB or normal Java helper classes and call the same from WD classes. If you use a core java helper class you can execute its method from WD. From a core java class you can create a table like below
String url = "jdbc:mySubprotocol:myDataSource";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME VARCHAR(32), " +
"SUP_ID INTEGER, " +
"PRICE FLOAT, " +
"SALES INTEGER, " +
"TOTAL INTEGER)";
Statement stmt;
try {
Class.forName("myDriver.ClassName");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "myLogin", "myPassword");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
But please dont use DDL, DML or any business processing in WD code directly.
Regards,
Shubhadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.