Skip to Content
avatar image
Former Member

Storing database in array string at runtime

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 26, 2009 at 07:07 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Satish Jhariya

      well satush do u have any doc/pdf related to this so that it willbe easy for me to cover up these..as i dont know how to achieve this...

  • avatar image
    Former Member
    Feb 26, 2009 at 08:08 AM

    Please see the below thread

    Storing database in array string at runtime

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 19, 2009 at 11:24 AM

    answered

    Add comment
    10|10000 characters needed characters exceeded