Best approch for Database connectivity

Hi All,
I am developing web application.
Can any one tell me that what is the best approch to use database connectivity for my web application?
how can i mentain my connection object throught out application?
Please help me about my improving code logic for web application.
Thanks
Pandev

Consider connection pooling.

Similar Messages

  • I build Messenger by RMI+SWING + ORACLE is it best Approch For Messenger?

    i make messenger like MSN by using RMI , Swing and oracle for database , now i want
    to asked is it best approch for makinng messenger which is work like MSN, and is it
    work proper when i host it for public use ?
    i also want to konw can i make it by using Servlet if yes then how ?
    and can i use beens for this perpouse ?
    If any body know about it then please tell me,
    Thanks
    M.Arif.

    Hi,
    I have worked on the same patterns long back and had done a lot.Anyway creating the application like msn is what you want or the Efficient Chat Application.I believe you will be interested in creating in chat application which will not decieve you at the critical point.
    The RMI technology is the best for the java programmer,In fact you can create the thing with the
    servlet but then there will be restriction ,the clients can only be browsers.So what you would
    like is to create the General application which will serve any of the user agent.Now the client can
    be swing,applet,browser or console.For each you will have to install the required software at the
    client side.
    But the server tech will remain same,the RMI server........
    i also want to konw can i make it by using Servlet if
    yes then how ?
    and can i use beens for this perpouse ?Yes you can do this.....
    But there will be restrictions,as you cannot get the latest info unless you send it from server.
    What you will have to do is create an object at the server which will interacted from the servlet,and the Object should contain all the info till the application is running.So you have to
    read,update,remove the data corresponding to each client from that object with invocation of servlet...
    Hope you understand............
    regards vicky

  • Could not load library for database connection LCA

    Hi,
    I am facing RFC connection prblem while connectiong to database. I have installed SCM5.1 and live cache in single server
    Please find the logs.
    Work process log:
    B Mon Jul 20 11:19:13 2009
    B  create_con (con_name=LCA)
    B  Loading DB library 'E:\usr\sap\SC7\DVEBMGS03\exe\dbsdbslib.dll' ...
    M  *** ERROR => DlLoadLib: LoadLibrary(E:\usr\sap\SC7\DVEBMGS03\exe\dbsdbslib.dll) Error 126 [dlnt.c       241]
    M          Error 126 = "The specified module could not be found."
    B  *** ERROR => Couldn't load library 'E:\usr\sap\SC7\DVEBMGS03\exe\dbsdbslib.dll'
    [dbcon.c      4731]
    B  ***LOG BYG=> could not load library for database connection LCA        [dbds#1 @ 1035] [dbds    1035 ]
    A
    A Mon Jul 20 11:21:58 2009
    A  GENER starting remote generation: /SAPAPO/OM_SYNC_LC_DB (requested by W1).
    B
    SM21:
    No shared library found for the database with ID LCA|
    No shared library found for the database with ID LCA
    /SAPAPO/OM17|/SAPAPO/OM_SYNC_LC_DB|K |SAP Web AS Problem|SBAC   |
    Documentation for system log message BY G :
    As well as the standard connection, an attempt was made to set up
    another database connection, under the specified ID. The Shared Library
    for this second database could not be found.
    The Shared Library is usually found in the the Executable
    directory (profile parameter DIR_LIBRARY) under the name dbs
    <dbs>slib<os_ext>. <dbs> stands for the database type and <os_ext>
    stands for the operating system-specific extension of the Shared
    Libraries.
    The database type is determined from the entry that corresponds to the
    specified DB ID in the table DBDCON. Check whether the data in this
    entry is correct.
    ST22
    Runtime Errors         DBIF_DSQL2_CONNECTERR
    Exception              CX_SY_NATIVE_SQL_ERROR
    Date and Time          20.07.2009 11:22:21
    Short text
    Error setting up a secondary database connection
    What happened?
    Connection to database system not possible with identifier "LCA".
    |----
    System environment
    SAP-Release 700
    Application server... "
    Network address...... "
    Operating system..... "Windows NT"
    Release.............. "5.2"
    Hardware type........ "8x AMD64 Level"
    Character length.... 16 Bits
    Pointer length....... 64 Bits
    Work process number.. 8
    Shortdump setting.... "full"
    Database server... "
    Database type..... "ORACLE"
    Database name..... "SC7"
    Database user ID.. "SAPSC7"
    Terminal................. " "
    Char.set.... "C"
    SAP kernel....... 701
    created (date)... "Jul 6 2009 23:47:55"
    create on........ "NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00"
    Database version. "OCI_10201_SHARE (10.2.0.2.0) "
    Patch level. 50
    Patch text.. " "
    Database............. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE 10.2.0.."
    SAP database version. 701
    Operating system..... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2, Windows
    NT 6.0"
    Information on where terminated
    Termination occurred in the ABAP program "SAPLSLCAPPS" - in
    "LCA_EXISTS_LCA_ROUTINE".
    The main program was "/SAPAPO/TS_BATCH_RUN ".
    In the source code you have the termination point in line 23
    of the (Include) program "LSLCAPPSU05".
    The program "SAPLSLCAPPS" was started as a background job.
    Job Name....... "MACROS"
    Job Initiator.. "SC7GEN"
    Job Number..... 10222002
    The termination is caused because exception "CX_SY_NATIVE_SQL_ERROR" occurred
    in
    procedure "LCA_EXISTS_LCA_ROUTINE" "(FUNCTION)", but it was neither handled
    locally nor declared
    in the RAISING clause of its signature.
    The procedure is in program "SAPLSLCAPPS "; its source code begins in line
    1 of the (Include program "LSLCAPPSU05 ".
    Please help me to resolve the issue.
    Suraj

    Hi Natalia Khlopina,
    I have raised OSS message to SAP.
    Below is the information
    E:\usr\sap\SC7\SYS\exe\uc\Copy_ of_NTAMD64_15062009>sdbregview -l
    Server Utilities    e:/sapdb/programs      7.7.02.08     64 bit    valid
    DB Analyzer         e:/sapdb/programs      7.7.02.08     64 bit    valid
    PCR 7301            e:/sapdb/programs      7.3.01.21               valid
    PCR 7500            e:/sapdb/programs      7.5.00.42     64 bit    valid
    SAP Utilities       e:/sapdb/programs      7.7.02.08     64 bit    valid
    APO LC APPS         f:/sapdb/lcs/db/sap    6.00.004      64 bit    valid
    Redist Python       e:/sapdb/programs      7.7.02.08     64 bit    valid
    Base                e:/sapdb/programs      7.7.02.08     64 bit    valid
    JDBC                e:/sapdb/programs      7.6.03.02               valid
    Messages            e:/sapdb/programs      MSG 0.5010              valid
    ODBC                e:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC 77           e:/sapdb/programs      7.7.02.08     64 bit    valid
    Database Kernel     f:/sapdb/lcs/db        7.7.02.08     64 bit    valid
    Loader              e:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC              e:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC 76           e:/sapdb/programs      7.6.01.15     64 bit    valid
    Fastload API        e:/sapdb/programs      7.7.02.08     64 bit    valid
    C:\Documents and Settings\sc7adm>disp+work
    disp+work information
    kernel release                701
    kernel make variant           701_REL
    compiled on                   NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00
    compiled for                  64 BIT
    compilation mode              UNICODE
    compile time                  Jul  6 2009 23:47:55
    update level                  0
    patch number                  50
    source id                     0.050
    supported environment
    database (SAP, table SVERS)   700
                                  701
    operating system
    Windows NT 5.0
    Windows NT 5.1
    Windows NT 5.2
    Windows NT 6.0
    Thanks for quick responce.
    Suraj

  • Noticing a lot of database index fragmentation yet no Health Analyzer alerts...? Best practice for database maintenance in 2013?

    Could someone point me to a document for best practices for database maintenance with SharePoint 2013? I have read the 2010 document, but I'm hoping their is an updated one that I'm just missing.
    My problem is that our DBA recently noticed that many of our SharePoint databases have high index fragmentation.  I have the Health Analyzer rules enabled for index fragmentation and they run daily, but I've never received an alert despite the majority
    of our databases having greater than 40% fragmentation and some are even above 95%.  
    Obviously it has our attention now and we want to get this addressed.  My understanding (which I now fear is at best incomplete, more likely just plain wrong) was that a maintenance plan wasn't needed for index fragmentation in 2010/2013 like it was
    in 2007. 
    Thanks,
    Troy

    It depends. Here are the rules for that job:
    Sampled mode
    Page count >24 and avg fragmentation in percent >5
    Or
    Page count >8 avg page space used in percent < fill_factor * 0.9 (Fill Factor in SharePoint 2013 varies from 80 to 100 depending on the index, it is important not to adjust index fill factors)
    I have seen cases where the indexes are not automatically managed by the rule and require a manual defragmentation with a Full Scan, instead of Sampled. Once the Full Scan defrag completed, the timer job started handling the index fragmentation automatically.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • What is the best IDE for database programming in java?

    im just new to java, i have experience in powerbuilder and visual basic. Im looking for an IDE for JAVA Database Programming that have same ease of use of the GUI builder of visual basic and power of the Datawindow in Powerbuilder.
    What is the best IDE for database programming in java?

    hey sabre why not just help me? instead of posting
    annoying replies. You want me to browse all the post
    two weeks ago to find what im looking for. stoopsMost regulars to this forum find X-posting annoying. Since you are lazy and want me to search the posts of the last couple of week for you, I find you very annoying.

  • What is the best router for mugs connectivity

                       i am looking for best networking institute in India, for optical networking please suggest, have heard about Networkers Zone (http://networkerszone.com/) , however needs suggestion and what is the best router for mugs connectivity.

    For training on the Cisco Optical I would rrecommend Fastlane http://www.fastlane.si/ they would be able to fullfill your training requirements either in India or at another location even at the Cisco Factory in Monza, they can tailor courses to your specific requirements and also do switching and routing courses too, I have know one of the instructors for over 10 years they are very good.
    As far as recommending the best router, that all depends on the application, not what you mean by mugs connectivity, I know what mugs is in English but not sure if thats what you mean or if it is an acronym for something else   in any case if you post in the router section of Net-Pro with your specific requirements I'm sure someone woule be able to help/advise accordingly.

  • Best way for Database Reorg.

    Hi Experts
    I want your advise on what is the best way for Database Re-Organizing / Database Refresh.
    Regards.

    Hi,
    what is the best way for Database Re-Organizing?Good question!
    Oracle's official way to do online table reorgs is with the dbms_redefinition utility, and here are my notes:
    http://www.dba-oracle.com/t_online_table_reorganization.htm
    Under the covers, it uses CTAS, which can also be done in parallel:
    http://www.dba-oracle.com/t_create_table_select_ctas.htm
    Of course, you can also do reorgs with Data Pump . . . .
    what is the best way for Database Refresh? I use a fast clone procedure:
    http://www.dba-oracle.com/oracle_tips_db_copy.htm
    Hope this helps. . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference":
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • Set password for database connection at runtime

    Hi there,
    is it possible to set the password and/or the user for the database connection at runtime.
    The use case is to read the values from a file and decrypt them, and the to establish the conenction. So that i don't habe to redeploy everything if there is a change.
    Thanks in advance.

    How exactly do i set these values for the datasource?
    Edited by: Alex on 15.02.2012 09:50
    €: JDeveloper 11.1.1.5.0
    The use case is, that there is a file with an encrypted password. This should be decrypted and then be used for the connection. So when this encrypted passowrd changes, i don't want to edit and deploay the app once again. Instead the new encrypted password should be decrypted via code an then be used.
    Edited by: Alex on 15.02.2012 10:00

  • Best practice for database calls from Java components?

    I have a java component that encapsulates some complex database logic. In unit tests, I pass in a jdbc connection.
    Is there a way to pass in a database connection from PBL for a database defined as an External Resource in an ALBPM project? That way, I can test it using the "abstract" definition in the project and know that when it is deployed to production it will use the concrete definition. And, I won't have to maintain a separate configuration of the JDBC url.
    Is there a better way to do this? Or is it possible?
    Thanks,
    Todd

    Hi Bruno,
    The main issue with the combination of stateful session beans and servlets is the servlet threading model.
    It is dangerous to store a stateful session bean reference in servlet instance state, since the servlet instance
    can be accessed concurrently, yet a stateful session bean reference is intended to be used by only one
    client.
    As you point out, one alternative is to store the reference in the HttpSession. That associates the reference
    with a particular client, which matches the stateful session bean programming model.

  • Best practice for RAC connections

    Got a question of what people consider best practice for setting up high-availability connection pools to a RAC cluster. Now that you can specify the fail-over logic right in the thin connection string it seems like there are three options.
    A) Use OCI connections and allow the fail-over logic to be maintained in the TNSNAMES.ORA file.
    B) Use simple thin connections with multi-pools and let WebLogic maintain the fail-over logic.
    C) Use simple thin connections with fail-over logic in the connection string.
    Thanks,
    Rodger...

    If you need XA, then follow the WebLogic documentation. If not, then
    you have much more freedom. The thin driver can be configured to
    use the tnsnames.ora file if that helps you. WebLogic much prefers the
    thin driver to the OCI-based one, which can kill a JVM with OCI bugs.
    If you do driver-level failover, each failed connection will cost a test
    and replace. If you use multipools, WLS can be configured to flush a
    whole pool when it finds a connection bad, and also make the failover
    at the pool level, right then, so application delay is minimized.
    Joe

  • Dynamic Parameter Prompting for Database Connection Password

    Post Author: rsharp
    CA Forum: Publishing
    Hi
    I've been finding recently that reports using dynamic parameters and published into Crystal Server prompt for the database connection password when the dynamic parameter is accessed.  Thing is, this only started happening recently for new and already existing reports with dynamic parameters and I don't know why.  In Crystal Reports the dynamic parameter can be accessed without a database connection prompt being displayed but not after publishing.  (Maybe there's a problem with the Publishing Wizard?)  Static parameters work just fine just as they always have, but I'm a bit mystified by the fact that dynamic parameters used to work (without prompting) but now they don't.  Any advice or opinion would be much appreciated.

    Post Author: amr_foci
    CA Forum: Publishing
    from the CMC you have to set the default connection or wat connection should this report use,
    go to this report in CMC, click process tab, and check the connection

  • Design question for database connection in multithreaded socket-server

    Dear community,
    I am programming a multithreaded socket server. The server creates a new thread for each connection.
    The threads and several objects witch are instanced by each thread have to access database-connectivity. Therefore I implemented factory class which administer database connection in a pool. At this point I have a design question.
    How should I access the connections from the threads? There are two options:
    a) Should I implement in my server class a new method like "getDatabaseConnection" which calls the factory class and returns a pooled connection to the database? In this case each object has to know the server-object and have to call this method in order to get a database connection. That could become very complex as I have to safe a instance of the server object in each object ...
    b) Should I develop a static method in my factory class so that each thread could get a database connection by calling the static method of the factory?
    Thank you very much for your answer!
    Kind regards,
    Dak
    Message was edited by:
    dakger

    So your suggestion is to use a static method from a
    central class. But those static-methods are not realy
    object oriented, are they?There's only one static method, and that's getInstance
    If I use singleton pattern, I only create one
    instance of the database pooling class in order to
    cionfigure it (driver, access data to database and so
    on). The threads use than a static method of this
    class to get database connection?They use a static method to get the pool instance, getConnection is not static.
    Kaj

  • Run Labview as different windows user (for database connectivity)

    I have to connect to a corporate remote MSSQL-Database on the network, using the database connectivity toolkit for LabVIEW.
    The db-authentification is realized checking the windows user (ads) who acceses the datebase (not a database user / password which is standard in the database vis)
    Therefore I have to run LabVIEW as the defined windows user, different than the logged in user on the pc.
    Is that possible to realize with LabVIEW?
    Other Windows-tools allow to define the windows user/password which "run" an application - how can I do that with LabVIEW?

    Hi Zav.  There is a windows command 'runas' which _may_ let you do what you want; I haven't
    tried what you need to do, but is has worked for other tasks for us.  Try 'runas /?' for the switches.
    You will have to build your LV program into an executable, then use runas to launch it.  Is there
    a reason you can't just login to Windows as the required user?
    If you can get your db admin to allow dbuser/password authentication that would be a much better
    way to go.
    Matt

  • SQL Query for Database Connections

    What would be the proper syntax or DBA table to query and find out how many database connections there are currently? Thanks for all of your help!!
    Marlan

    select * from v$session;Some entries in this view are dynamic processes (type = 'BACKGROUND') and you may want to exclude those depending on your requirements.

  • Report in production prompts for database connection info

    Hi,
    I'm using SAP Crystal Reports version for VS 2010 SP1. I'm trying to implement the most basic need--to create reports in a development environment and move them to production by just copying the .rpt files. I want to rely on the database connection string from web.config, but don't see how that is done. I've tried using ADO.NET DataSets from Project Data and can get the report to run while developing, but when I move to another server I'm always prompted with the "The report you requested requires further information" dialog.
    I tried this solution, which keeps the db server name in a web.config variable:
               ReportDocument boReportDocument = new ReportDocument();
                boReportDocument.Load(Server.MapPath(rmCR.SelectedItem.Value.ToString()));
                ConnectionInfo boConnectionInfo = new ConnectionInfo();
                boConnectionInfo.ServerName = ConfigurationManager.AppSettings["dbServerName"];
                boConnectionInfo.DatabaseName = "dbCMRP_Employees";
                boConnectionInfo.IntegratedSecurity = true;
                ModifyConnectionInfo(boReportDocument.Database, boConnectionInfo);
                // Modify the ConnectionInfo for all tables in all subreports
                foreach (ReportDocument boSubreport in boReportDocument.Subreports)
                    ModifyConnectionInfo(boSubreport.Database, boConnectionInfo);
                Session.Add("Report", boReportDocument);
                Response.Redirect("CrystalReportsViewer.aspx");
    and this works fine in development, but when moved to a different server I get the "The report you requested requires further information" dialog. I've made sure that the db has the correct security settings, but can't find anything missing.
    I'm sure I'm missing something basic, but can't seem to find any solution after searching for days. Any solution that allows me to create the report in VS 2010 and copy to a production server will be appreciated.
    Thanks,
    Dan

    Thanks for your replies.
    I think I've done what's outlined in the Troubleshooting Guide link that Ludek gave me.  I did install Process Monitor and found the "Access Denied" entry, but I'm not sure which folder needs permission given to IIS APPPOOL\ASP.NET v4.0.
    Here's the entry from Process Monitor:
    Description:        IIS Worker Process
    Company:           Microsoft Corporation
    Name:  w3wp.exe
    Version:               7.5.7601.17514
    Path:     C:\Windows\SysWOW64\inetsrv\w3wp.exe
    Command Line:                C:\Windows\SysWOW64\inetsrv\w3wp.exe -ap "ASP.NET v4.0" -v "v4.0" -l "webengine4.dll" -a
    .\pipe\iisipm461f344a-3d68-4e7c-b42e-ca18eac4553c -h "C:\inetpub\temp\apppools\ASP.NET v4.0\ASP.NET v4.0.config" -w "" -m 0 -t 20
    PID:        7512
    Parent PID:         3892
    Session ID:          0
    User:     IIS APPPOOL\ASP.NET v4.0
    Auth ID:               00000000:00465886
    Architecture:     32-bit
    Virtualized:         False
    Integrity:             High
    Started:                8/29/2011 1:03:58 PM
    Ended:  (Running)
    Modules:
    w3wp.exe           0x120000             0x8000  C:\Windows\SysWOW64\inetsrv\w3wp.exe      Microsoft Corporation                7.5.7601.17514
    Microsoft.Web.Administration.dll            0x28ae0000        0x24000                C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Administration\7.0.0.0__31bf3856ad364e35\Microsoft.Web.Administration.dll                Microsoft Corporation   6.1.7601.17514
    App_Web_822ce1a1f503e532a2e860f7ce344f6d0d0f2eba.ascx.3417f053.eb4fk61t.dll     0x28b10000        0x8000                C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\intranet\58a686e6\86baa618\App_Web_822ce1a1f503e532a2e860f7ce344f6d0d0f2eba.ascx.3417f053.eb4fk61t.dll                n/a         0.0.0.0
    App_Web_aed28e8a45aa161f6c9fc3f563283cb89b317bdc.ascx.3417f053.rodqolhn.dll     0x28c90000         0x8000                C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\intranet\58a686e6\86baa618\App_Web_aed28e8a45aa161f6c9fc3f563283cb89b317bdc.ascx.3417f053.rodqolhn.dll                n/a         0.0.0.0
    pvlocale-1-0.dll 0x2fc80000          0x76000                C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\pvlocale-1-0.dll      SAP BusinessObjects                14.0.0.760
    System.Data.Entity.ni.dll              0x2fd50000         0xcb8000                C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Data.Entity\978e8514751373383f79c3fdd667aa2b\System.Data.Entity.ni.dll                Microsoft Corporation   4.0.30319.1

Maybe you are looking for