on 02-26-2009 6:57 AM
Hi all, as mention in the given code I have taken the database in the respected String arrays, but instead to take in single array for each attribute ,I want to take in single String[] array for all database attribute.
Basically whenever I am inserting or selecting database the application of webdynpro is taking nearly 20 secs which I have to reduce it to nearly 4-5 secs... So I am thinking to take the entire database in a single array [] for insert or selection on it and update in the database only onceu2026
So plz guide me, how to resolve this database issue through single string [] array or is their in any other way to resolve, the reduction of time complexity of the runtime applications.
Try
{
String driver name="com.microsoft.jdbc.sqlserver.SQLServerDriver";
Class.forName (driver name);
String URL="jdbc:microsoft:sqlserver://**.*..**:1433;
Database Name=*****";
Conn=DriverManager.getConnection (URL,"sa","super");
Statement stmt=conn.createStatement ();
String insertion="Select * from Project ";
Prepared Statement pstmt=conn.prepareStatement (insertion);
Result Set rs=null;
Rs=pstmt.executeQuery ();
String Pname [] = new String [1];
String Tdesc [] = new String [1];
Date Sdate [] = new Date [1];
Date Edate [] = new Date [1];
String NOD [] = new String [1];
While (rs.next ())
{
For (int i=0; i<Pname.length; i++)
{
Pname<i> = rs.getString ("TASKNAME");
Tdesc<i> = rs.getString ("TASKDESC");
Sdate<i> = rs.getDate ("Sdate");
Edate<i> = rs.getDate ("Edate");
NOD<i> = rs.getString ("NOD");
PrivateArrayView.ITableElement element=wdContext.createTableElement ();
element.setTaskname (Pname<i>);
element.setTaskdesc (Tdesc<i>);
element.setStartdate (Sdate<i>);
element.setEnddate (Edate<i>);
element.setNOD (NOD<i>);
wdContext.nodeTable ().add Element (element);
}
Regards:
SK
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please see the below thread
Storing database in array string at runtime
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Have you done all coding related to database in same component if yes put it in different component which will serve whole back end stuff to your application. It will improve application performance .
Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
What I mean is Put your complete Database related code in separate Component .which will like a faceless component and only purpose of this component is serving other component if they require anything related to database (either EJB, WebServices etc)
1. Create One Comp ,Write all the method of insertion and deletion into this component controller and expose these method into Interface controller so that other component can use it (It fulfill the criteria of Reuse of the Component ).
2.Define the uses relationship of this component with other ,then starting calling those method.
3. Now the View-Controller role is only to call those method which is required in for example
addData(name,class,age);it could be one of the method which u have defined in Step1
4.So what we will achieve through this is
a) Proper componentization it mean distribution of the task through component.
b) Let View handle only presentation logic of the application(Which is opposite in your case ).
c)Performance of the application it means it reduce the request-response cycle time.
Hope I am clear now,but again u r welcome
Best Regards
Satish Kumar
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.