Need  suggestion to handle Database

Hi All...
I am developing a web-application on struts framework. Here i need to interact with database.
all i wanted to do is to make DAO classes for establishing connection with DB & retreiving / fetching data into DB through SQL querries .
but as i am doing it ... for each module i have module specific DAO classes .
I don't want to connect with database again & again as module is switched to another .
I want to make a dedicated connection with database once when the application is loaded ie: at the login page itself DB connection will get established.
I come to know about connection pooling ....I have no idea about how it can help in my web-app.
I guess connection pooling is done where multiple request to connect with DB occur.
In my case all i want is one dedicated connection with DB when app is loaded & when user logs out DB connection disconnect.
Can anybody help me knowing what should i do for my requirement .
also please tell me what is the concept of connection pooling.Any kind of help is appreciable.
Thanks in advance.

In my case all i want is one dedicated connection with DB when app is loaded & when user logs out DB connection disconnect.i doubt you really want to do this
use the connection pool instead
it's not that difficult to setup
Can anybody help me knowing what should i do for my requirement .
also please tell me what is the concept of connection pooling.Any kind of help is appreciable.you can Google for general in formation on connection pooling
there are lots of solutions out there and most, if not all, come with docs on how to configure and use the pool

Similar Messages

  • Need suggestion for a database connection issue in an EJB Application

    Hi Friends,
    I am facing some serious problem in my EJB application. Some times, my application is waiting for unknown reason while it connects to database as executing a stored procedure to get and assign a unique number to a transaction.
    This stored procedure is used to get a unique number from database and update the database with the new unique number which is incremented by previous number.
    During this waiting time, if any other transaction hits my application, then my application assigning same unique number to these 2 transactions.
    But It is not happening always. It is happening very less number of times. What should I take care of the code to not happen this? Can I implement any synchronization kind of thing here?
    If I implement synchronization kind of thing, If the first transaction gets the lock and waits for some time, then I think it will effect for subsequent transactions. Could You please suggest me on this issue?
    Thanks in Advance to All.

    Here is my datasources.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>     
         <bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
              <property name="jndiName" value="jdbc/myDS"/>
              <property name="resourceRef" value="false"/>
         </bean>
    </beans>

  • Need Suggestion on handling events

    I have 2 caches . The 1st cache is populated with more than million records .The 2nd cache has a real time feed populating the cache and updating it quite frequently . I have a requirement of doing some calculation on 1st cache based on updates happening in 2nd cache.
    What is best way to handle the events happening on 2nd cache? Should i use backing map listeners or handle the event from client side and run a entry processor to do the calculations on Cache1 ?

    Use an EntryProcessor on Cache1 (positions) to perform the updates to Position objects. Position calculations are usually pretty simple, so the use of an EP is probably fine. You'll want to gather the list of target position keys before doing the invokeAll() call, so all the affected Positions are updated in parallel.
    As to how you trigger the EP, a listener on cache1 would be one approach. Make sure the caches are running on separate services to avoid re-entrancy issues.
    We use the EP approach for our Position updates and find we can process many tens of thousands / second using EPs.
    You'll probably also want to re-use the above ideas in order to maintain an audit trail, as this would normally be in a separate cache (i.e. not in the Positions cache) and written-behind to a db.
    If your price-change notifications are so frequent that they exceed your ability to process them (even using invokeAll on EPs), then you might want to look at some form of async processing. The CommandPattern in the Incubator is one such example; of course you could also roll your own.
    Cheers,
    Steve

  • Need suggestion in getting data using JDBC

    Hi all need suggestion,
         i had a VO corresponding to database table.
         when i am try to get the records from that table,
         how can i initialize the particular column value to the
         corresponding VO setter method.
         please do the needful.

    Hello inform2csr,
    Your question is not so clear.
    Can you be more precise?
    What is VO?

  • Need suggestion for choosing Java development enviroment

    Hi Evereyone,
    I am new to Java Desktop Application.I need help on choosing proper Java technologies and development tool.
    We have an existing CLIENT/SERVER based distributed control system, which was developed in C++(Server side) and VB(Client GUI).Now we are think of migrating the system to Java platform.
    Here is the outline:
    We want to create web based application that will run on windows and linux (linux on embedded PC).
    The application should be able to support 10 � 100 users at once accessing/editing database.
    We will also need to create a communication server that will run on web server P.C. that will communicate tcpip to field panels/log to db, as well as allow web screens to send/receive commands with field panels etc.
    Could any one give me some suggestion about it?
    I am thinking of Using J2SE 5.0, including RMI, JDBC and Swing for GUI. As for field panels, may choose J2ME.
    Thank you very much in advance.

    Thanks, zadok .
    Actually, I don't have the system requirements neither. All I know is the following outline:
    "We want to create web based application that will run on windows and linux (linux on embedded PC).
    The application should be able to support 10 � 100 users at once accessing/editing database.
    We will also need to create a communication server that will run on web server P.C. that will communicate tcpip to field panels/log to db, as well as allow web screens to send/receive commands with field panels etc."
    It is a interview question, which need me to do research and give some suggestions. What I want to know is to figure out what kind of Java technology is necessary for developing this system because I want to make sure I head to right direction.
    I know somehow it is hard to give suggestion based on this limited information.
    One more thing I was confusing is the server-side architecture.
    I need suggestion about sever side architecture:
    a. write a dedicated server-side program, which act
    as communication server to monitor and control field
    panel, also act as server-side applicaiton by using
    RMI to communicate with Client-side communication.
    b. choose a general web server architecture. Put
    everything in server side in Web Server, for example
    Tomcat AS container, implementing the Communication
    server as Web Service and the request from
    Client-side go to Web Server first, then dispatch to
    a proper web service.Why did you not include this information in the original question!
    Why don't you just use Tomcat?
    For your answer, "Why don't you just use Tomcat?", does it mean Tomcat without Web Service will be enough for this system development? Could you give me some detail about it?
    Thank you very much, zadok.

  • What is the best methodology to handle database schema changes after an application has been deployed?

    Hi,
    VS2013, SQL Server 2012 Express LocalDB, EF 6.0, VB, desktop application with an end user database
    What is a reliable method to follow when there is a schema change for an end user database used by a deployed application?  In other words, each end user has their own private data, but the database needs to be expanded for additional features, etc. 
    I list here the steps it seems I must consider.  If I've missed any, please also inform:
    (1) From the first time the application is installed, it should have already moved all downloaded database files to a separate known location, most likely some sub-folder in <user>\App Data.
    (2) When there's a schema change, the new database file(s) must also be moved into the location in item (1) above.
    (3) The application must check to see if the new database file(s) have been loaded, and if not, transfer the data from the old database file(s) to the new database file(s).
    (4) Then the application can operate using the new schema.
    This may seem basic, but for those of us who haven't done it, it seems pretty complicated.  Item (3) seems to be the operative issue for database schema changes.  Existing user data needs to be preserved, but using the new schema.  I'd like
    to understand the various ways it can be done, if there are specific tools created to handle this process, and which method is considered best practice.
    (1) Should we handle the transfer in a 'one-time use' application method, i.e. do it in application code.
    (2) Should we handle the transfer using some type of 'one-time use' SQL query.  If this is the best way, can you provide some guidance if there are different alternatives for how to perform this in SQL, and where to learn/see examples?
    (3) Some other method?
    Thanks.
    Best Regards,
    Alan

    Hi Uri,
    Thank you kindly for your response.  Also thanks to Kalman Toth for showing the right forum for such questions.
    To clarify the scenario, I did not mean to imply the end user 'owns' the schema.  I was trying to communicate that in my scenario, an end user will have loaded their own private data into the database file originally delivered with the application. 
    If the schema needs to be updated for new application features, the end user's data will of course need to be preserved during the application upgrade if that upgrade includes a database schema change.
    Although I listed step 3 as transferring the data, I should have made more clear I was trying to express my limited understanding of how this process "might work", since at the present time I am not an expert with this.  I suspected my thinking
    is limited and someone would correct me.
    This is basically the reason for my post; I am hoping an expert can point me to what I need to learn about to handle database schema changes when application upgrades are deployed.  For example, if an SQL script needs to be created and deployed
    then I need to learn how to do that.  What's the best practice, or most reliable/efficient way to make sure the end user's database is changed to the new schema after the upgraded application is deployed?  Correct me if I'm wrong on this,
    but updating the end user database will have to be handled totally within the deployment tool or the upgraded application when it first starts up.
    If it makes a difference, I'll be deploying application upgrades initially using Click Once from Visual Studio, and eventually I may also use Windows Installer or Wix.
    Again, thanks for your help.
    Best Regards,
    Alan

  • Urgent help : Need to recover a database without backup and archivelogs

    Hi,
    We are in urgent need to recover a database without backup and archivelogs
    one datafile seems corrupted
    SQL> recover automatic database until cancel using BACKUP CONTROLFILE;
    ORA-00279: change 10527325422479 generated at 07/27/2011 03:13:04 needed for
    thread 1
    ORA-00289: suggestion : /pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc
    ORA-00280: change 10527325422479 for thread 1 is in sequence #181845
    ORA-00278: log file '/pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc' no
    longer needed for this recovery
    ORA-00308: cannot open archived log
    '/pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc'
    ORA-27037: unable to obtain file status
    HP-UX Error: 2: No such file or directory
    Additional information: 3
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    CANCEL
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/pys/u2/oradata/PYS/pay_system_01.dbf'

    N Gasparotto wrote:
    bsac14 wrote:
    my database is in no archive mode
    can you please tell how to restore
    yes it is a datafile corruptionYou did not say how you defined that's a datafile corruption. You provide minimum to zero information.
    I just need to bring the database up,no need any exact data
    I can refresh from prod laterThen drop and recreate database. Basically and since you are not in archive mode, no recover is possible. Period.
    Nicolas.Hi,
    How did you come to the conclusion that your datafile is corrupted? Can you provide and supported logs?
    Regards .....

  • RMAN Recovery failing , Need Suggestion

    RMAN Recovery is failing 3 times with these errors , need suggestion
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/20/2006 22:44:32
    RMAN-03015: error occurred in stored script Memory Script
    ORA-19504: failed to create file "/oradata/F3LIPO/system/tools_01.dbf"
    ORA-27040: skgfrcre: create error, unable to create file
    HP-UX Error: 2: No such file or directory
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of allocate command at 09/20/2006 23:12:27
    RMAN-06403: could not obtain a fully authorized session
    RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    HP-UX Error: 2: No such file or directory
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/21/2006 12:24:56
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06136: ORACLE error from auxiliary database: ORA-01013: user requested cancel of current operation

    My concern is
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/21/2006 12:24:56
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06136: ORACLE error from auxiliary database: ORA-01013: user requested cancel of current

  • I need suggestions for an online trading application

    Hi,
    I am going to develop an online trading application. I have decided to use JAVA EE 5 and I have read "The Java(tm) EE 5 Tutorial". Because I am a (C++) programmer and new to Java, I need suggestions to start development.
    Here is summary of the system in my mind. There will be
    a database to store user's information and operations,
    a web client for creating and managing user accounts,
    a desktop application and web client for users for online trading and
    an application client for brokers for risk management.
    Here is a sample scenario for flow,
    - User wants to create an account
    - Company creates an account for user
    - user gets the prices and trades via application client (web or desktop)
    - system informs dealers and broker via their client platform
    - broker perform necessary operations.
    Java EE 5 Application model fits the system I am trying to develop but I feel I still need some guidance and there are a few things I couldn't figured out yet. For these reasons I want to develop a prove of concept system and this is the system in my mind.
    - A simple database
    user (user_id, user_login, user_password, user_name)
    stock (stok_id, stok_name)
    operation (op_id, user_id, stok_id, op_type, op_amount, op_value)
    - A price server
    will generate random prices and push new values to registered clients
    - A web client to create new users (for admin)
    - A web client to display operations of users (for user)
    - A desktop application and web client for operation entries (for users)
    displays prices coming from price servers, sends users trade requests
    - A desktop application client for informing admin about trades (for admin)
    when a user buys or sells something, this client notified (user buy/sell something)
    What do you offer for this sample system?
    Which is the best IDE?
    Which Application Server should I use (scalability and speed is critical)?
    Which Java EE APIs should I use?
    JSP or JSF?
    Will I need hibernate?
    And so on.. I need some points to start and go.
    Thanks for any help.
    Ahmet

    It wouldn't be an arbitrary track. However, maybe you could make an arbitrary track by dividing the track into segments. Each segment is either a straight line or an arc. These are easy to model the cars' behavior on, because you'll have a straightforward way to determine the direction the car should be facing, and the range to the left and right where the car can stray and still be on the track.

  • I need to create handling units by serial numbers in HUPAST

    Hello Experts,
    I need to create handling unit by serial numbers instead of Batch Numbers.
    Please suggest me how we can do this.
    Thanks,
    Gaurav

    Hi
    Check the following link
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/62f21d43-0c01-0010-4094-f870e02c6264
    Cheers
    Chandra

  • Need to Clone A Database From Solaris to Linux Oracle 11g

    Hi Team,
    I am using Oracle Database Version 11.2.0.1.
    We have 6 production servers and all of them are in solaris box. We have a new requirement from application to use Linux boxes and for that we need to perform a database refresh from Solaris to Linux box.
    I can do it by Export and Import technique. But I want some other way to perform this database refresh activity.
    1] Can I do it while taking a rman backup from solaris box( Source) and restore it back to Linux( Target)?
    2] Can I do it using transportable tablespace method?
    I am aware of performing this using export-import but as our database size is near of 1TB I can't apply this technique.
    I need your suggestions in this activity, please put your opinion on the correct method I should opt for and along with that share me the supporting document where things are mentioned in step by step way.
    Please let me know if this can achieved by RMAN...
    Source Machine Make:-
    bash-3.00$ uname -a
    SunOS blrdlvdwhdb01 5.10 Generic_142909-17 sun4v sparc SUNW,Sun-Blade-T6320
    Target System Make:-
    Linux blrulvremoradb01 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
    Regards,
    Arijit

    Yes, you can create a backup with rman and restore in other platform, check:
    How To Use RMAN CONVERT DATABASE on Source Host for Cross Platform Migration - 413586.1
    Cross-Platform Migration on Destination Host Using Rman Convert Database - Note 414878.1
    but easier and faster will be with expdp/impdp.

  • Suggest a good database?  (criteria within)

    I currently use a Microsoft Access to store data, which I then use to generate a static website using a Java application I wrote.
    The reason I use Java so heavily is that it is platform-agnostic; I hate losing code when a platform (DOS, Windows 3.1, Win9x, soon WinNT) goes away.
    Now, building an application I'd like to sustain for many years in a portable language and then using a MS database for the data is obviously quite silly. I'd like to find a database which runs on most platforms (especially Windows and Linux, my current platform and the one I will eventually move to) and which has easily portable data files. Access is easy - one .mdb file holds everything I want to move. Do other databases support this?
    MySQL seems to have lots of required bits - ACL's etc - that I'm not interested in, and occasionally a x.y version db fails to work with an x.y+1 or x+1.y version. Not good.
    Any suggestions? I'm curious about a db called Cloudscape - has anyone done anything with it?
    thanks for your time, folks,
    Andrew

    I have no direct suggestion except to note the fact even though a
    specific database may be currently seem to be the answer does in
    any way guarantee what will happen in the future. You will only
    be betting on the most likely choice. Many databases that have
    seemed to be the best bet have effectively vanished in the past.
    I do suggest you design your product so the database functions
    all are localized in single blocks of code and the functions
    used throughout your code. This means if at a later date you
    need to change the database the changes you require will all
    occur only in those areas.
    You must realize that the long term success of programming
    products do not rely on the fact they are currently the best thing
    since sliced bread. Marketing and the market place (customers) drive
    the most successful products. Not I said successful not best. You may
    find you want to change to another database product long before the one
    you are using has ceased to exist.
    rykk

  • 300 Users: need suggests...

    Hi all! I need to configure an oracle database server (9.2.0.4.0) in order to guarantee that 300 users can connect and use the database in the same time... I need suggests regarding hardware (Cluster? Parallel server?)and software requirements to satisfy this request based on your DBA experience.
    Can you help me?
    Thank you in advance.
    Bye.
    Ste.

    OLTP is ok, the max workload is 300 users using database at the same time. I think that 9i Enterprise Edition + Real Application Cluster is too expensive... 10g includes Real Application Cluster... Is this right? Then I think the hardware can be like this:
    2 server (2 cpu), 2 Gb ram for every server, 1 disk array (4 x 73 Gb) with 2 fiber ports without NAS (for the moment)... Do you know if there is some vendor that sells a system like this for using with Oracle so it is not necessary to buy every device from different vendors and to read long compatibility lists? Do you know any "success case" I can read to find some usefull information regarding the configuration of such a system?

  • Need Suggestion for Archival of a Table Data

    Hi guys,
    I want to archive one of my large table. the structure of table is as below.
    Daily there will be around 40000 rows inserted into the table.
    Need suggestion for the same. will the partitioning help and on what basis?
    CREATE TABLE IM_JMS_MESSAGES_CLOB_IN
    LOAN_NUMBER VARCHAR2(10 BYTE),
    LOAN_XML CLOB,
    LOAN_UPDATE_DT TIMESTAMP(6),
    JMS_TIMESTAMP TIMESTAMP(6),
    INSERT_DT TIMESTAMP(6)
    TABLESPACE DATA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    LOB (LOAN_XML) STORE AS
    ( TABLESPACE DATA
    ENABLE STORAGE IN ROW
    CHUNK 8192
    PCTVERSION 10
    NOCACHE
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOPARALLEL;
    do the needful.
    regards,
    Sandeep

    There will not be any updates /deletes on the table.
    I have created a partitioned table with same struture and i am inserting the records from my original table to this partitioned table where i will maintain data for 6 months.
    After loading the data from original table to archived table i will truncating the original table.
    If my original table is partitioned then what about the restoring of the data??? how will restore the data of last month???

  • I want to set up the Time Machine and I would love to use the Time  Capsule but since I already have a wireless router I need suggestions on  what other external disks Apple could recommend to use with the Time Machine and  how to configure that disk

    I want to set up the Time Machine and I would love to use the Time
    Capsule but since I already have a wireless router I need suggestions on
    what other
    external disks Apple could recommend to use with the Time Machine and
    how to configure that disk.
    A complication that I need to resolve is the fact that I am using Vmware
    Fusion to be able to use Windows on my Mac. Now it seems that Time
    Machine is not backing up my files
    on that virtual Windows without additional configuration and my question
    is whether you can advise me here or whether this is only a matter for
    the Fusion virtual machine.

    If you want to use Time Capsule you can.. you simply bridge it and plug it into the existing router.. wireless can be either turned off or used to reinforce the existing wireless.. eg use 5ghz in the TC which is much faster than your 2.4ghz.
    You can also use a NAS.. many brands available but the top brands are synology, qnap and netgear readynas  series. These will all do Time Machine backups although how well always depends on Apple sticking to a standard. There are cheaper ones.. I bought a single disk zyxel which was rebadged and sold through my local supermarket. It actually works very well for TM at least on Snow Leopard. Major changes were made in Lion and again ML so do not instantly think it will work on later versions. I haven't tried it yet with those versions.
    Any external drive can be plugged into the mac. Use the one with the fastest connection or cheapest price according to your budget. USB2 drives are cheap and plentiful. But no where near as fast as USB3 or FW800. So just pick whichever suits the ports on your Mac. Interesting Apple finally moved to USB3 on their latest computers.
    TM should exclude the VM partition file.. it is useless backing it up from Mac OS side.. and will slow TM as it needs to backup that partition everyday for no purpose.. TM cannot see the files inside it to backup just the changes.
    You need to backup windows from windows. Use MSbackup to external drive.. if you have pro or ultimate versions you can backup to network drive. But MSbackup is a dog.. at least until the latest version it cannot restore the partition without first loading windows. There are about a zillion backup software versions for windows.. look up reviews and buy one which works for you. I use a free one Macrium Reflect which does full disk backups and is easy to restore.. to do incremental backups though you have to pay for it.

Maybe you are looking for