How to make a faster connection to a database?

Hi there,
I have a created sth like an ebook reader for html books. I have a highlight tool and a textfield to keep some notes for each page. When the user goes from one page to there other I do connect and disconnect to the database 4 times. One to save the highlights of the page, one to save the notes and another to load these in characteristics to my new page.
Acutally I do sth like this:
      //Save the highlights and the notes of the current page
      no.saveNotes();
      hi.saveHighToDB();
       // Load and display specified page.
       ViewClass.getEditorPane().setPage(pageUrl);
       //Load the highlights and the notes of the new page
       hi.loadingMakeHighlight();
       no.LoadNotes();This make my program very slow. It takes along time to load the new page. The whole program, database and book run locally so it should be faster 'cause afterwards I want to put in the book and the database on a server.
Is there a way to make less connections or sth to make it faster??
Is it better/faster to make 1 connection to save the 2 things and 1 to load them? The saveNotes() and LoadNotes() are in the same class and the saveHighToDB() and loadingMakeHighlight() are in a different one. How I can solve this?
Thanks in advance

You need a connection pool so you can recycle connections. This will speed things up tremendously!

Similar Messages

  • How to make SAP B1 connection with Windows Sharepoint Service 3.0

    how to make SAP B1 connection with Windows Sharepoint Service 3.0 through asp.net web part code.. I get the security error when i run that web part......
    public bool ConnectToCompany()
                oCompany = new SAPbobsCOM.Company();
                oCompany.Server = "192.168.1.58";
                oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;
                oCompany.CompanyDB = "SBODemoUS";
                oCompany.DbUserName = "sa";
                oCompany.DbPassword = "abc";
                //oCompany.UseTrusted = true;
                oCompany.UserName = "manager";
                oCompany.Password = "manager";
                oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English;
                oCompany.LicenseServer = "192.168.1.58:30000";
                int i = oCompany.Connect();
                if (i != 0)
                    return false;
                return true;
    protected override void RenderContents(HtmlTextWriter writer)
                if (conn.ConnectToCompany() == true)
                    writer.Write("Hello" + this.Context.User.Identity.Name);
    Edited by: bikalg on Nov 28, 2010 9:43 AM

    Hi.......
    Welcome to SAP Business One Forum.....
    Unfortunately this is the wrong forum you posted here.
    I would suggest you post it in SDK or System Administration Forum and definitely you get the solution and close this thread from here......
    Regards,
    Rahul

  • Slow Phone 4s with ios8!! How to make it faster?

    Slow Phone 4s with ios8!! How to make it faster? After upgraded ios8.1.1, my iPhone 4s Facebook become very slow response and always hand. Whastapp having same problem! Very lagging with safari too! It is really regret to upgrade since many peoples say upgrade will have this issue always

    Slow Phone 4s with ios8!! How to make it faster? After upgraded ios8.1.1, my iPhone 4s Facebook become very slow response and always hand. Whastapp having same problem! Very lagging with safari too! It is really regret to upgrade since many peoples say upgrade will have this issue always

  • How to make script faster

    Hi,
    I have a table with huge volume of data. I am doing following activity using SQL script
    1). alter table my_tab add new_col NUMBER(10);
    2). update my_tab set new_col= 50;
    3). alter table my_TAB modify new_col NOT NULL;
    4). Create index on my_tab(new_col);
    Above scrip is taking around 10 hours to excecute.
    Could any one please suggest how to make it fast.
    Thanks.

    amit_hum wrote:
    Hi,
    I have a table with huge volume of data. I am doing following activity using SQL script
    1). alter table my_tab add new_col NUMBER(10);
    2). update my_tab set new_col= 50;
    3). alter table my_TAB modify new_col NOT NULL;
    4). Create index on my_tab(new_col);
    Above scrip is taking around 10 hours to excecute.
    Could any one please suggest how to make it fast.
    Thanks.You haven't told us your database version.
    You haven't shown us the details of your table structure or an example of the data, or even how many rows is a "huge volume of data".
    Without proper information we would just be guessing and that doesn't help anybody.

  • How to DELETE millions of records. How to make it fast.

    Hi
    I need to delete near abt 134 millions of records from tables.
    How to make it faster? any trick , any settings.
    I am using Oracle 9i on Linux box.
    If suppose i use TRUNCATE . does it deletes all objects defined over tables like constraint, indexes etc.
    Thanks,
    Kuldeep

    hi
    SQL> create table te as select * from all_objects;
    Table created.
    SQL> create index te_ind on te ( owner);
    Index created.
    SQL> truncate table te;
    Table truncated.
    SQL> select index_name , status from user_indexes where table_name = 'TE';
    INDEX_NAME                     STATUS
    TE_IND                         VALID
    SQL> create table ti as select * from all_objects;
    Table created.
    SQL> create index ti_ind on ti ( owner);
    Index created.
    SQL> drop table ti;
    Table dropped.
    SQL> select index_name , status from user_indexes where table_name = 'TI';
    no rows selected
    SQL>regards
    Taj

  • How to make the wifi connection with Ipad in china since it requires user's name and password.

    How to make the wifi connection with Ipad in china since it requires user's name and password just like the dialed-up?

    The same way you would connect to a secure wifi network in any other country. Supply the username and password when prompted.

  • How do the application servers connect the new database after failing over from primary DB to standby DB

    How do the application servers connect the new database after failing over from primary DB to standby DB?
    We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application team would like to know:
    When the primary DB server is crashed, the standy DB server will takeover the role of primary DB through the DataGuard fast failover. As the applications are connected by the primary DB IP before,currently the physical DB is used as a different IP or listener. If this is happened, they need to stop their application servers and re-configure their connection so the they coonect the new DB server, they cannot tolerate these workaround. 
    Whether does oracle have the better solution for this so that the application can automatically know the role's transition and change to the new IP without re-confige any connection and shutdown their application?
    Oracle support provides us the answer as following:
    ==================================================================
    Applications connected to a primary database can transparently failover to the new primary database upon an Oracle Data Guard role transition. Integration with Fast Application Notification (FAN) provides fast failover for integrated clients.
    After a failover, the broker publishes Fast Application Notification (FAN) events. These FAN events can be used in the following ways:
    Applications can use FAN without programmatic changes if they use one of these Oracle integrated database clients: Oracle Database JDBC, Oracle Database Oracle Call Interface (OCI), and Oracle Data Provider for .NET ( ODP.NET). These clients can be configured for Fast Connection Failover (FCF) to automatically connect to a new primary database after a failover.
    JAVA applications can use FAN programmatically by using the JDBC FAN application programming interface to subscribe to FAN events and to execute event handling actions upon the receipt of an event.
    FAN server-side callouts can be configured on the database tier.
    FAN events are published using Oracle Notification Services (ONS) and Oracle Streams Advanced Queuing (AQ).
    =======================================================================================
    Who has the experience and the related documentation or other solutions? we don't have the concept of about FAN.
    Thank very much in advance.

    Hi mesbeg,
    Thanks alot.
    For example, there is an application JBOSS server connecting the DB, we just added another datasource and put the standby IP into the configuration file except adding a service on DB side like this following:
            <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                    <datasource jta="false" jndi-name="java:/jdbc/idserverDatasource" pool-name="IDServerDataSource" enabled="true" use-java-context="true">
                        <connection-url>jdbc:oracle:thin:@<primay DB IP>:1521:testdb</connection-url>
                        <connection-url>jdbc:oracle:thin:@<standby DB IP>:1521:testdb</connection-url>
                        <driver>oracle</driver>
                        <pool>
                            <min-pool-size>2</min-pool-size>
                            <max-pool-size>10</max-pool-size>
                            <prefill>true</prefill>
                        </pool>
                        <security>
                            <user-name>TEST_USER</user-name>
                            <password>Password1</password>
                        </security>
                        <validation>
                            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
                            <validate-on-match>false</validate-on-match>
                            <background-validation>false</background-validation>
                            <use-fast-fail>false</use-fast-fail>
                            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
                            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
                        </validation>
                    </datasource>
                    <drivers>
                        <driver name="oracle" module="com.oracle.jdbc">
                            <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
                        </driver>
                    </drivers>
                </datasources>
            </subsystem>
    If the failover is occurred, the JBOSS will automatically be pointed to the standby DB. Additional actions are not needed.

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to make Mavericks faster on an "older" MacBook Pro?

    I have a late 2011 MacBook Pro, 2.2 GHz core i7 with 4 GB of RAM. I recently wiped my computer and restored to factory settings because it was getting slow, then I upgraded to Mavericks and it is even slower. It freezes often and takes a long time to load things. Is there any way to make it faster or improve it's function?

    Oh wow, I must be REALLY out of it, haha, don't know how I missed that.
    Hardware Information:
              MacBook Pro (15-inch, Late 2011)
              MacBook Pro - model: MacBookPro8,2
              1 2.2 GHz Intel Core i7 CPU: 4 cores
              4 GB RAM
    Video Information:
              Intel HD Graphics 3000 - VRAM: 384 MB
              AMD Radeon HD 6750M - VRAM: 512 MB
    System Software:
              OS X 10.9.1 (13B42) - Uptime: 0 days 4:2:0
    Disk Information:
              TOSHIBA MK5065GSXF disk0 : (500.11 GB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        Dalek Caan (disk0s2) /: 499.25 GB (466.87 GB free)
                        Recovery HD (disk0s3) <not mounted>: 650 MB
              MATSHITADVD-R   UJ-8A8 
    USB Information:
              Apple Inc. FaceTime HD Camera (Built-in)
              Iomega Iomega Select HDD 500.11 GB
                        EFI (disk1s1) <not mounted>: 209.7 MB
                        FAT-32 (disk1s2) /Volumes/FAT-32: 400.11 GB (48.79 GB free)
                        Mac (disk1s3) /Volumes/Mac: 99.66 GB (27.63 GB free)
              Apple Inc. Apple Internal Keyboard / Trackpad
              Apple Inc. BRCM2070 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Computer, Inc. IR Receiver
    FireWire Information:
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Kernel Extensions:
    Problem System Launch Daemons:
    Problem System Launch Agents:
    Launch Daemons:
              [loaded] com.google.keystone.daemon.plist 3rd-Party support link
    Launch Agents:
              [loaded] com.google.keystone.agent.plist 3rd-Party support link
    User Launch Agents:
              [loaded] com.valvesoftware.steamclean.plist 3rd-Party support link
    User Login Items:
              iTunesHelper
              Steam
    Internet Plug-ins:
              googletalkbrowserplugin: Version: 4.9.1.16010 3rd-Party support link
              QuickTime Plugin: Version: 7.7.3
              o1dbrowserplugin: Version: 4.9.1.16010 3rd-Party support link
              npgtpo3dautoplugin: Version: 0.1.44.29 - SDK 10.5 3rd-Party support link
              Default Browser: Version: 537 - SDK 10.9
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
              AirPlay: Version: 1.9 - SDK 10.9
              AppleAVBAudio: Version: 2.0.0 - SDK 10.9
              iSightAudio: Version: 7.7.3 - SDK 10.9
    3rd Party Preference Panes:
              None
    Bad Fonts:
              None
    Old Applications:
              /Library/Printers/EPSON/InkjetPrinter2/Utility/UT4
                        Epson Printer Utility 4:          Version: 9.14 - SDK 10.5 3rd-Party support link
                        EpsonSuppliesTool4:          Version: 8.61 - SDK 10.5 3rd-Party support link
              MiroVideoConverter:          Version: 2.6 - SDK 10.0 3rd-Party support link
    Time Machine:
              Time Machine not configured!
    Top Processes by CPU:
                  10%          Skype
                   5%          WindowServer
                   3%          VLC
                   2%          EtreCheck
                   1%          coreaudiod
    Top Processes by Memory:
              182 MB          Google Chrome Helper
              131 MB          VLC
              123 MB          Google Chrome
              119 MB          Skype
              102 MB          Mail
    Virtual Memory Information:
              42 MB          Free RAM
              1.49 GB          Active RAM
              1.45 GB          Inactive RAM
              960 MB          Wired RAM
              1.17 GB          Page-ins
              2 MB          Page-outs

  • How to make qry fast

    I have a small query
    select * from x order by b asc
    its very slow how can i make it fast as i have to order .

    "Small" is a vague, relative term. It's the volume of data that matters more I would think, and I'm guessing your table is "large" for the hardware you are running on. In any case, if you are truly doing the select to "push it in some target table" then I would say first off, you don't need the "order by" in this query. Secondly, if you are really trying to load data to a table, perhaps it is the insert that you don't show here that is the problem?
    Check out /*+ APPEND */ and /*+ PARALLEL */ hints just for grins.
    MJG

  • How to make this faster?? read millions of record from txt file

    Hi there,
    I got an issue. There is a txt file contains 2 million records, I also got another file contains over 10000 numbers. Now, I need to compare this 10000 numbers with that 2 million records if any records contains a number which belongs to 10000 number set, i retrieve this record and keep it. later on, when i finish the comparison i'll write all the result records into a txt file.
    What kind of data structure shall i use to keep the records and numbers? how to make the comparison quicker? Any idea will do!
    Thanks!

    if i were to do it, i will insert bout the records into the db. then do an sql statement on the two tables to get the results. Then get the rs and output it to another text file.
    just my opinion. not sure if this is faster.
    Message was edited by:
    clarenceloh

  • How to make Portal faster?

    Hi all,
    The portal on which i am working has become very slow.It is NW04S Portal.
    It is taking a lot of time for processing.
    Can any one tell me <b>how to make my portal</b> <b>faster</b> by cleaning or any stuff.
    I vl award points if it is helpful to me.
    Thanks in advance.
    Message was edited by:
            Satish Dhanalakoti
    Message was edited by:
            Satish Dhanalakoti

    Hi,
    Refer this link
    https://websmp101.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000061538&_SCENARIO=01100035870000000112&_OBJECT=011000358700000590032004E
    Regards,
    Senthil K.

  • How to make mac faster

    my mac has become very slow in starting and during shut down. can anyone help to make it faster?

    How slow?

  • Painfully slow startup - any suggestions how to make it faster?

    Hi Everyone,
    Just thought I'd ask people - my 17" iMac G5 1.9GHz PowerPC with 512MB ram is painfully slow at start-up. Seems to take forever! Does anyone know how I could clear a lot of rubbish from my computer and someone make it faster.
    Would anyone recommend a complete re-install - would that improve speed?
    Any help appreciated, cheers,
    Mark

    Mark, you can clear space on your drive and speed it up by moving a lot of sound and video files to a DVD, or even better, to an external; Firewire drive that you can partition and also use as a clone boot disk.
    Go through your applications folder and look for stuff that you never use, then get AppZapper to remove all traces of them. You can also use Monolingual to remove the tons of extra languages installed with Word and OS X, just make sure you uncheck English and any other language you might use.
    Hope some of this helps,
    Miriam

  • Slow Equuim A200 - How to make it faster?

    Help!
    My Equium A200 has gone really slow. Keep getting not responding messages on internet.
    Even typing this is very slow. Im not very knowledgeable about computers but do keep security updated.
    Please help me if there is anything I can do.

    There are a lot options to make Windows faster.
    I can give you some examples:
    1. Check the msconfig: start =&gt; run =&gt; msconfig.
    At startup you can see all programs who started with the notebook. Remove the tick from the programs, they should not startup with Windows.
    2. Defragment your HDD: click on my computer =&gt; right click on the HDD =&gt; properties =&gt; tools =&gt; Defragment now.
    Defragmentation is a process that reduces the amount of fragmentation in file systems.
    Which OS (operating system) do you use? If you use Windows Vista, install SP1. If you use Windows XP, install SP2 or SP3.
    In my opinion Windows OneCare is not really good. Choose an other security suite. I use for a lot of years Kaspersky. I had never problems with it and the system runs fast.
    To check how much RAM do you have, make a right click on my computer =&gt; properties and there you can see it.
    If everything doesn&rsquo;t help, you should reinstall Windows with the Recovery image from Toshiba. All drivers and tools are including.
    But if you do this, backup your data first. The HDD will completely erased.

Maybe you are looking for

  • Can an iPad be backed up to two  Macs?

    We recently upgraded my wife's iPad 2 to an iPad Air and I will inherit the old one. The old one was originally set up with my Apple ID so that is not a problem, and the new one is properly on my wife's Apple ID. However, I have always used my 2010 i

  • Slow network printing (cups)

    hi, i have a Brother HL-2150N Laserprinter connected via a crossover cable directly to my laptop. (KDE4, Kernel 26-2.6.29.1-3, cups 1.3.9-4). Printer is configured as HP LaserJet Series PCL 6 CUPS (URI: lpd://192.168.10.2/binary_p1) Printer works fin

  • Printing from an iMac to a printer connected to a router

    I have a HP LaserJet 2100 connected to my router (via Parallel Port), and shared across my windows home network. The printer is easily located within the 'windows' section of 'add printer', and the correct driver is selected. When I try to print anyt

  • PDF conversion in smartfrom

    Hi experts, From my report i have to genarate 3 smartfroms by clicking checkboxes in report.so 3 smartfroms are coming fine.when i press back for each smartfrom it should genarate pDF for that smartfrom. in mycode i ma using 3 Convert_off FM's ... if

  • Xml slideshow playback controls issue

    Hi, I'm trying to create a picture slideshow which can be controled by the user with play / stop / next buttons. I've managed to program the play / stop events with success, but I'm stuck trying to create the next button event since it doesn´t work p