How do i:  persistent in-memory table access

I'm porting an application to a BEA web service. In the existing application, for performance, a table was built from a record file and kept resident in RAM for the life of the application with methods provided for locating a record in that RAM based table.
Using weblogic I could use a database control to get the record I need however the performance hit is unacceptable hence the RAM based table.
I could create an entity EJB however persistence through an EJB appears to still utilize database I/O for session persistence so we'd trade one database I/O for another.
Any suggestions?

David,
"David Eberwine" <[email protected]> wrote in message news:1377384.1092937779978.JavaMail.root@jserv5...
I'm porting an application to a BEA web service. In the existing application, for performance, a table was built from a recordfile and kept resident in RAM for the life of the application with methods provided for locating a record in that RAM based table.
>
Using weblogic I could use a database control to get the record I need however the performance hit is unacceptable hence the RAMbased table.
>
I could create an entity EJB however persistence through an EJB appears to still utilize database I/O for session persistence sowe'd trade one database I/O for another.
>
Any suggestions?What was the question?
Regards,
Slava Imeshev

Similar Messages

  • How to free persistent data memory?

    Hi,
    Recently I have been working on card applet developing.In my applet I want to use EEPROM to hold a large file, so I apply byte array[] in class constructor.
    In Write method I write data to the byte array[]; In Delete method I want to make the byte array[] null,so I used "byte array[] = null".
    When I test it in emluator it works well, the data I wrote in the byte array can be removed. But when I test it in the real card, if I want to delete the file (equals with making the byte array null) I always got the error.
    So I want to know how to free persistent data memory, dos "= null"work?
    Thanks

    Java Cards are not required to support automatic garbage collection, although some do.
    On Java Card there is a feature called object deletion which can be implemented as garbage collection but can also be implemented differently. Please read the related section in the Java Card Runtime Environment Specification.
    With
    javacard.framework.JCSystem.isObjectDeletionSupported()
    you can check if object deletion is supported on your card.
    With
    javacard.framework.JCSystem.requestObjectDeletion()
    you can request it for the next call of the process method.
    And don't forget to clear all your references to the object which is to be deleted.

  • Problem with Table Access Full

    Hi,
    Please help me how to resolve the problem of table access full, when i am executing query i facing a problem with these. all though i have create index on these is queru but execution time taking too late.
    Also please help if there any syntax to run faster execution.
    Thanks in Advance
    Sreenivas

    Hi,
    Please try to analyze your tables once with DBA's help.
    If the above does not work, try to use hints which will force use the index created on the column.
    Do not use any conversion functions on that column, in the where clause while checking any condition.
    If you are storing numbers in a character column, try to have the conditional value as character value in where clause instead of number type.
    Thanks and Regards,
    Sridhar.

  • How to find out the query is accessing the DB tables or not

    Hi Gurus ,
    How to find out the query is accessing the DB tables or not.
    Where exactly we will find this information in SAP BW.
    I know that this information we can find in ST03. But where exactly we will find the query information along with DB information?

    Lakshmi
    Activate BI Technical Content for Query analysis and run query against that.
    Hope this helps
    Thanks
    sat

  • How to use the item of table(ms access) in pl/sql

    I want to use oracle forms builer developer application with ms access database
    I don't know how to use the item of table in the pl/sql;please help me !

    MERGE INTO EmpDept Target
    Using (SELECT E.Address,
    e.Design,
    e.EmailId,
    e.EmpId,
    e.Ename,
    e.ManagerId,
    e.Salary,
    D.DeptId,
    D.DeptName,
    D.Location
    FROM Employee E
    INNER JOIN Dept D
    ON E.DeptId = D.DeptId) AS Source (Address, Design, EmailId, EmpId, EName, ManagerId, Salary, DeptId, DeptName, Location)
    ON Source.EmpId = Target.EmpId
    WHEN NOT matched THEN
    INSERT (Address,
    Design,
    EmailId,
    EmpId,
    Ename,
    ManagerId,
    Salary,
    DeptId,
    DeptName,
    Location)
    VALUES (Address,
    Design,
    EmailId,
    EmpId,
    EName,
    ManagerId,
    Salary,
    DeptId,
    DeptName,
    Location)
    WHEN matched THEN
    UPDATE SET Address = Source.Address,
    Design = Source.Design,
    EmailId = Source.EmailId,
    Ename = Source.Ename,
    ManagerId = Source.ManagerId,
    Salary = Source.Salary,
    DeptId = Source.DeptId,
    DeptName = Source.DeptName,
    Location = Source.Location;

  • Raw pointer access to in-memory tables

    Hello, I realize this is quite an odd question, but I was wondering if it's possible to obtain raw pointers to rows stored in an in-memory table introduced in SQL Server 2014.
    What I am trying to do is to use AMD Kaveri APU in conjunction with SQL Server 2014. The APU has 500+ shader cores that can perform an operation on a piece of memory in parallel, and since SQL Server 2014 already keeps these tables in memory, I was hoping
    there is a way to reference these tables directly via pointers that can be used by APU cores (I could create wrapper code in CLR if needed) rather than taking data out of the database and creating in-memory arrays. All data types I am interested in are fixed
    length (doubles) and tables can be locked in the "read-only" state while read operations take place.
    Is it possible to access in-memory tables via raw pointers?

    Hi Popsovy,
    Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    If you have any feedback on our support, please click
    here.
    Elvis Long
    TechNet Community Support

  • How to keep location in a table persistent when switching between pages

    Hi -
    How would I keep my last location persistent in a table when switching between pages? If I am on cell X and switch to another page, when returning to the previous page, I return to the top of the table. This can be very annoying when trying to find the same location in a large table (or even in a small one).
    Thanks.

    If by "page" you mean "sheet", you can do it. To get back to the same place you were in the other sheet, click on the sheet in the sidebar (the list of sheets/tables/charts/etc on the left). Don't click on the table, click on the sheet.

  • How to Restrict a user to a access a particular table

    HI ,
    how to restrict an user to a one particular table and he should have only dispaly authorization for that , can anyone suggest me how to do this.

    Hi,
    Is it a standard table ? S_TABU_DIS (Client Dependant) and S_TABU_CLI (Cross client) are the the authorization objects that controls table maintenance. With Authorization group and activity 03, you can give user access only to Display.
    You can look at table TDDAT to find the authorization group of the table. If it is a custom table for which original t-code is SM30 ( You can look at SU24 to verify that) and it does not have authorization group assigned to it, then you can ask your developer to assign authorization group to the table using t-code SE54. then again make use of S_tabu_dis with activity 03 and Auth group as designed to restrict access.
    Also something to look for is Note 1481950 - New authorization check for generic table access using new auth object S_TABU_NAM. Remember Bernhard talking about it.
    Edited by: Nishant Sourabh on Oct 1, 2010 8:13 PM

  • How improve performance on access path TABLE ACCESS BY INDEX ROWID ?

    I have table MOVEMENT with about 26millions entries,
    select rowid from movement xxx
    where
    xxx.sTransType > 0
    AND xxx.sDevice < 1000
    AND xxx.sDevice >= 0
    AND (bitand(xxx.sSaleFlag,1) = 0 AND bitand(xxx.sSaleFlag,4) = 0)
    AND xxx.sArtClassRef < 100
    and xxx.tActionTime BETWEEN TO_DATE('13-05-2011 08:08:34', 'dd-mm-yyyy hh24:mi:ss') AND to_date('13-05-2011 14:08:34', 'dd-mm-yyyy hh24:mi:ss') ;
    PLAN_TABLE_OUTPUT
    Plan hash value: 679628763
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 34 | 10102 (1)| 00:02:02 |
    |* 1 | TABLE ACCESS BY INDEX ROWID| MOVEMENT | 1 | 34 | 10102 (1)| 00:02:02 |
    |* 2 | INDEX RANGE SCAN | MOVATIME_IX | 18489 | | 51 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("XXX"."SARTCLASSREF"<100 AND BITAND("XXX"."SSALEFLAG",1)=0 AND
    BITAND("XXX"."SSALEFLAG",4)=0 AND "XXX"."STRANSTYPE">0 AND "XXX"."SDEVICE"<1000
    AND "XXX"."SDEVICE">=0)
    2 - access("XXX"."TACTIONTIME">=TO_DATE('2011-05-13 08:08:34', 'yyyy-mm-dd
    hh24:mi:ss') AND "XXX"."TACTIONTIME"<=TO_DATE('2011-05-13 14:08:34', 'yyyy-mm-dd
    hh24:mi:ss'))
    there is index on tActionTime - MOVATIME_IX
    This query returns 12203 rows, so I would anticipate this number in plan table in row with id 1 and column Rows
    Final question if it is possible to optimize this query and what are the next steps to do it?
    Thanks.

    >
    I thought that access path via ROWID's is the fastest way to get row
    >
    It is the fastest way to get the row - FROM THE TABLE.
    But the ROWIDs have to be gotten from the index. That is what the INDEX RANGE SCAN is doing. It is getting the ROWIDs needed and then the TABLE ACCESS BY INDEX ROWID is getting the rows.
    >
    I'am still confused with COST values, TABLE ACCESS BY INDEX ROWID has 200times higher cost than INDEX RANGE SCAN,
    >
    The index entries for a range scan are in order so they are very compact. The actual rows might be all over the place.
    Have you ever you a library? Not the online ones - I mean the old-fashioned kind that actually has books printed on paper?
    If the librarian asks you, her helper, to go get all books whose title begins with the letter 'B' how would you do it?
    You could go back to the stacks and look at every book on every shelf for books with titles' starting with 'B'. That is the same as a FULL TABLE SCAN.
    Or you could go to the card catalog, pull out the drawer (or drawers) that has 'B' on the label and look at the information on the card. Part of that information is the location of the actual book: section, stack; that is similar to the ROWID.
    The card catalog might get you to the right stack of books; then you have to search the stack sequentially to look for the book by name.
    A ROWID will get Oracle to the right block but then it has to find the right row.
    So the cost of getting ROWIDs from an index using a RANGE SCAN (where values are scanned in order) is a lot cheaper than actually getting the rows. The first two index entries needed might be right next to each other in order but the rows themselves might be far apart on the disk.

  • How to make optimizer fetch and join values from Indexes, no table access.

    Hi All,
    i am having a query which is just checking the existence of the values according to some of the filter criteria, and involves two tables in join. and i want optimizer to find the existence i.e the reult of the query by only accessing indexes only, not to go through table scan using indexes. Is there any way so that i can modify my query or force the optimizer to do the same? below is the existing plan of the query in which its accessing tables using indexes, which causing bottleneck in my DB as these tables are bulky ones.
    Execution Plan
    Plan hash value: 1209914516
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | | 6 (17)| 00:00:01 | | |
    | 1 | SORT AGGREGATE | | 1 | | | | | |
    |* 2 | FILTER | | | | | | | |
    | 3 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 | | |
    | 4 | NESTED LOOPS | | 1 | 24 | 4 (25)| 00:00:01 | | |
    | 5 | SORT UNIQUE | | 1 | 10 | 2 (0)| 00:00:01 | | |
    | 6 | TABLE ACCESS BY INDEX ROWID | INVOICELINEDISB | 1 | 10 | 2 (0)| 00:00:01 | | |
    |* 7 | INDEX RANGE SCAN | IDX_INVLINEDISB_UOMCD | 1 | | 1 (0)| 00:00:01 | | |
    | 8 | PARTITION HASH ITERATOR | | 1 | 14 | 1 (0)| 00:00:01 | KEY | KEY |
    |* 9 | TABLE ACCESS BY GLOBAL INDEX ROWID| INVOICEHEADERDISB | 1 | 14 | 1 (0)| 00:00:01 | ROWID | ROWID |
    |* 10 | INDEX UNIQUE SCAN | P_INVOICEHEADERDISB_PART | 1 | | 0 (0)| 00:00:01 | KEY | KEY |
    Predicate Information (identified by operation id):
    2 - filter( EXISTS (SELECT 0 FROM "XIGNCMN"."INVOICEHEADERDISB" "INVOICEHEADERDISB","XIGNCMN"."INVOICELINEDISB"
    "INVOICELINEDISB" WHERE "INVOICELINEDISB"."UNITOFMEASURECD"='USD' AND
    "INVOICEHEADERDISB"."INVOICEPK"="INVOICELINEDISB"."INVOICEPK" AND "INVOICEHEADERDISB"."PAYPK"=8135488395))
    7 - access("INVOICELINEDISB"."UNITOFMEASURECD"='USD')
    9 - filter("INVOICEHEADERDISB"."PAYPK"=8135488395)
    10 - access("INVOICEHEADERDISB"."INVOICEPK"="INVOICELINEDISB"."INVOICEPK")
    Statistics
    0 recursive calls
    0 db block gets
    14 consistent gets
    0 physical reads
    0 redo size
    410 bytes sent via SQL*Net to client
    385 bytes received via SQL*Net from client

    Jonathan Lewis wrote:
    930254 wrote:
    Hi All,
    i am having a query which is just checking the existence of the values according to some of the filter criteria, and involves two tables in join. and i want optimizer to find the existence i.e the reult of the query by only accessing indexes only, not to go through table scan using indexes. Is there any way so that i can modify my query or force the optimizer to do the same? below is the existing plan of the query in which its accessing tables using indexes, which causing bottleneck in my DB as these tables are bulky ones.
    Execution Plan
    Plan hash value: 1209914516
    | Id  | Operation                              | Name                     | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                       |                          |     1 |       |     6  (17)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE                        |                          |     1 |       |            |          |       |       |
    |*  2 |   FILTER                               |                          |       |       |            |          |       |       |
    |   3 |    FAST DUAL                           |                          |     1 |       |     2   (0)| 00:00:01 |       |       |
    |   4 |    NESTED LOOPS                        |                          |     1 |    24 |     4  (25)| 00:00:01 |       |       |
    |   5 |     SORT UNIQUE                        |                          |     1 |    10 |     2   (0)| 00:00:01 |       |       |
    |   6 |      TABLE ACCESS BY INDEX ROWID       | INVOICELINEDISB          |     1 |    10 |     2   (0)| 00:00:01 |       |       |
    |*  7 |       INDEX RANGE SCAN                 | IDX_INVLINEDISB_UOMCD    |     1 |       |     1   (0)| 00:00:01 |       |       |
    |   8 |     PARTITION HASH ITERATOR            |                          |     1 |    14 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |*  9 |      TABLE ACCESS BY GLOBAL INDEX ROWID| INVOICEHEADERDISB        |     1 |    14 |     1   (0)| 00:00:01 | ROWID | ROWID |
    |* 10 |       INDEX UNIQUE SCAN                | P_INVOICEHEADERDISB_PART |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    Predicate Information (identified by operation id):
    2 - filter( EXISTS (SELECT 0 FROM "XIGNCMN"."INVOICEHEADERDISB" "INVOICEHEADERDISB","XIGNCMN"."INVOICELINEDISB"
    "INVOICELINEDISB" WHERE "INVOICELINEDISB"."UNITOFMEASURECD"='USD' AND
    "INVOICEHEADERDISB"."INVOICEPK"="INVOICELINEDISB"."INVOICEPK" AND "INVOICEHEADERDISB"."PAYPK"=8135488395))
    7 - access("INVOICELINEDISB"."UNITOFMEASURECD"='USD')
    9 - filter("INVOICEHEADERDISB"."PAYPK"=8135488395)
    10 - access("INVOICEHEADERDISB"."INVOICEPK"="INVOICELINEDISB"."INVOICEPK")
    The sort unique at line 5 is surprising, I can't think of an obvious reason why it should appear unless the optimizer is trying to do something very clever to work around a problem we can't see (such as a statistics error with the hash partitioned indexe).
    Assuming that the test would do better starting with invoiceheaderdisn.paypkl I have to ask if you have an index on INVOICELINEDISB(INVOICEPK).The optimizer's choice of driving table indeed looks odd. Could it be due to misleading statistics or plain bug or just a case of CBO preferring a non-partitioned table over partitioned table when deciding the driving table? I must admit this design does look odd as it appears INVOICEHEADERDISB is a parent table and INVOICELINEDISB is a child table but somehow the parent table has been partitioned (using hash partitioning, I assume) but the child table is not.
    However, once CBO has decided the driving table, the SORT UNIQUE is not quite surprising. Assuming optimizer knows that there is a parent-child relationship between INVOICEHEADERDISB and INVOICELINEDISB table (based on INVOICEPK column), CBO needs to access only INVOICEPK and UNITOFMEASURECD columns fron the INVOICELINEDISB table in order to process the join. It uses index range scan on UNITOFMEASURECD table in order to get (part of) the necessary data and then accesses INVOICELINEDISB table to get the values of INVOICEPK column. Being a child table, it is possible that the driving row source will contain duplicate values for INVOICEPK column but not necessarily sorted. As CBO knows that outer table (i.e. INVOICEHEADERDISB) has a PK on INVOICEPK column, each row in driving row source will have either 1 or 0 rows matching from outer table. It appears that CBO "decides" that by eliminating the duplicate values of the INVOICEPK from driving row source, it can reduce the number of times the INVOICEHEADERDISB table is accessed.
    Now I am not sure if CBO does all this (eliminating duplicates from driving row source) only because the outer table is partitioned.
    Coming back to OP's original question, I believe OP will have to change the index definitions in order to avoid table access for this query. But there has to be a strong and logical argument to make this kind of change for just one query.
    Hope this helps.

  • How Do I identify a Memory Leak?

    I know this is not enought information but...
    My application used 3 hashtables in a Data object to store application data. I retrive this data from an XML file. I also download XML and merge it into andother XML file. Some of these hashtables contain object that contain more hashtables.
    I am trying to use JProbe Profiler to find the leak. I notice the memory increases when I load the data into objects and put them into hash tables. I also notice an increase when I am merging newly downloaded XML into the current XML data. I am useing Nodelists and NOdes to get the data.
    Does anyone have any tips or suggestion on how to find a memory leak?
    Thank you,
    Al

    7 MB of XML file, loaded into a DOM? You realize, of
    course, that DOMs are data structures that take up
    memory, too, right?Yes I do. I load it into DOM then go through the Document and put the XML data into a custom file format (seialized objects). The data is sent from the server in the form of XML.
    There's your problem. If you load X MB into memory
    and keep it around as long as your application is
    running, that's not necessarily a "leak". Yeah I realized this but it seems that if I load 7MB of my objects into hashtables my memory usage shouldn't increase by 30MB. I just assumed it would stay around 10MB.
    The real issue is trading memory for CPU. If keeping
    them in memory is crashing your app with OOM errors,
    by all means just keep those objects in memory for as
    long as you need them and then let the GC clean them
    up. Don't put them in a Map, just let them have a
    narrow method scope. Recreate them every time you
    need them. Yes I'm beginning to see the light.
    I'm sure you're thinking, "But recreating them will
    cost CPU and slow down my app!" Yes, that's why it's
    a tradeoff between memory and CPU.
    Do you really need the whole document in memory at
    once? If you're just cherry picking a few values out
    of it, maybe you can use a SAX parser instead of a
    DOM.
    No I don't need all that data at once.
    >
    Either you're screwed or you need to rethink this.
    You'd better hope that it's really not needed at
    every moment for every client.After rethinking, I'm going to keep the serialized data in the file until I need it. Rather than searching through a hashtable for the object I want I will search the file.
    What are your JVM settings for -Xms and -Xmx? Maybe
    increasing those will do the trick.I did increase them and it helped a little, but I can still get a OutOfMemoryError if I try.
    Are you sure these are the culprits? Have you
    profiled the app to see if there are other sources of
    leaks?Yes I have been profiling the application. It seems that there is a memory leek. I am just having trouble identifing it. I know the memory increases at 2 points. When I load the XML data into the DOM and when I load the DOM into my Custom object and then into the Hashtables.
    Last resort? Buy more physical memory. It's cheap.I think I am going to keep unused data out of memory and access it form a file. After I make this change I think my memory usage will drop alot. I will profile again after I have this change made to see if there is a memory leak.
    Thanks for you help,
    Al

  • How to display value in memory

    How to display value in memory, except call function 'LIST_FROM_MEMORY' .
    Thanks.

    Hi
    See this
    may be useful
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
    SAP global memory retains field value through out session.
    set parameter id 'MAT' field v_matnr.
    get parameter id 'MAT' field v_matnr.
    They are stored in table TPARA.
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
    to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    ABAP memory is temporary and values are retained in same LUW.
    export itab to memory id 'TEST'.
    import itab from memory Id 'TEST'.
    Here itab should be declared of same type and length.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    ABAP Memmory & SAP Memmory
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Reward points for useful Answers
    Regards
    Anji

  • With query and table access

    I am using WITH query to reduce the scanning the teacher table thrice for the below query
    xe > with q as
      2  (select  teacher_id,subject_1,subject_2,subject_3 from teacher
      3  )
      4  select teacher_id,subject_1 from q
      5  union all
      6  select teacher_id,subject_2 from q
      7  union all
      8  select teacher_id,subject_3 from q
      9  /
    However, the execution plan shows that the table was scanned for twice.
    Execution Plan
    Plan hash value: 91048842
    | Id  | Operation          | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |         |     6 |   180 |     6  (67)| 00:00:01 |
    |   1 |  UNION-ALL         |         |       |       |            |          |
    |  2 |   TABLE ACCESS FULL| TEACHER |     2 |    60 |     2   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS FULL| TEACHER |     2 |    60 |     2   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS FULL| TEACHER |     2 |    60 |     2   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
             10  recursive calls
              0  db block gets
             22  consistent gets
              0  physical reads
              0  redo size
            594  bytes sent via SQL*Net to client
            420  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              6  rows processed
    Why the table was scanned thrice?
    Thanks for your time..

    Hi,
    A SQL query describes the result set you want; it does not show how the system gets those results.  Don't expect how the query code looks to have much to do with what the system will do.  For example, the fact that the code only says "teacher" 1 time doesn't mean that the teacher table will only be scanned 1 time.
    Try
    SELECT    teacher_id, subject
    FROM      teacher
    UNPIVOT   ( subject
              FOR  subject_num IN ( subject_1  AS 1
                                  , subject_2  AS 2
                                  , subject_3  AS 3

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • INDEX UNIQUE SCAN instead of   INDEX FULL SCAN or TABLE ACCESS FULL

    I have calculated statistics in all tables and indexes
    I have a table and a view and when I put it
    SELECT *
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    But If I put
    SELECT A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    In table A make a TABLE ACCESS FULL.
    Then If I put:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    Finally, If I put other tables and views in the query (I NEED IT)
    For example:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    INNER JOIN TABLE_C….
    LEFT JOIN VIEW_D….
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX FULL SCAN (FIELD_A_TABLE_A_PK)
    I need INDEX UNIQUE SCAN instead of INDEX FULL SCAN or TABLE ACCESS FULL.
    How can obtain it?
    What happens???
    Thanks!

    Notice the difference in cardinality between your two select statements:
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=5 Cardinality=1
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=10450 Cardinality=472161Apparently since the optimizer believed the first statement was going to return one row, it used an index. But in the second statement it believed it was going to return nearly the whole table (didn't you say it had around 500k rows?). Hence full table scan.

Maybe you are looking for

  • Problem with printing from an URL

    Hi, my first post on this forum......so hello everyone !! Im trying to print a file on my server from a flash app, I have been using the printJob class. This function always spools the whole of my parent .swf file and not the file pointed at by the U

  • Searching for a certain  binary tree from another tree........

    I have been struggling for a tree search problem for a good while. Now I decide to ask you experts for a better solution :-). Given a binary tree A. We know that every Node of A has two pointers. Leaves of A can be tested by if(node.right = =node). N

  • Will there ever be an update to Microsoft Messenger?

    I know on Windows there is the new Windows Live Messenger. I just would like to know if there will be an update to Microsoft Messenger for Mac anytime soon. I hate the fact Mac users are limited to no webcam or audio or games. I know there are progra

  • Seeing 'AJPRequestHandler-RMICallHandler-14' on our log lot

    Does anyone know what is this exception and what triggers this to happen? "AJPRequestHandler-RMICallHandler-24" prio=1 tid=0x5fff41e8 nid=0x11cc runnable [0x631be000..0x631bff20]      at java.net.SocketInputStream.socketRead0(Native Method)      at j

  • Won't allow hold down delete (Mtn Lion)

    For whatever reason, I can't press and hold down my delete key. It stops after deleting one character, rather than continuing on. The same goes for my arrow keys. If I hit shift twice, a white arrow appears locking everything into an "alt" key stage