Suggest me the best practise for accesing database by JSP page

Hi,
Can you please suggest me the best practises to connect to database through JSP page.
I am using the Struts-Portlet environment. And I have to display some contents from the database to the jsp page(view.jsp).
Please suggest.
Saurabh.

If you know how to use struts and portlets, you wouldn't be asking this question. I suggest looking into the Model-View Controller pattern to get an idea how to set up a web application, then think about how to do it in a portlet environment.

Similar Messages

  • What is the best practise for setting dirty flag of a page/view?

    For a page/view, normaylly there are 2 things to do for diry data:
    1. when it's clean, Save button is disabled, when it's dirty, save button is enabled.
    2. when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".
    My thought is: it must be handled at client side, because not all valuechange is auto submitted. E.g., you type the 1st letter of a string in a input box, the server side does not know it, but save button should be enabled immediately.
    Is it possible to capture all valueChange events in a page or a view at client side?
    I'm not sure what is the best practise for setting dirty flag? If there is better solution? Does ADF provide facility for this?

    public void save(ActionEvent event){
    boolean formValid = isFormValid();
       if (formValid) {
      save button is enabled.
        private boolean isFormValid() {
            boolean valid = true;
            if (Check Condition 1) {
                valid = false;
               showErrorMessage1();
            if (Check Condition 2) {
                valid = false;
               showErrorMessage1();
            return valid;
        private void showErrorMessage1() {
                    when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".

  • Suggestions about the best tool for quality check for an ADF application

    Hi All,
    I need a few suggestions about the best tool for quality check in our ADF applicaiton.
    ours is a small size WebCenter Portal application which neither uses any task flows nor consumes any portlets.
    It has many jspx pages that use ADF components like table etc, consume web services using web service clients, and has some java classes.
    We have come across below option to implement the code quality tools.
    1. Jdeveloper inbuilt Staus option in View tab
    2. PMD extension for Jdeveloper
    3. Red Samurai
    Few more suggestions or best practices would be really helpful.
    Thanks,
    Usha

    Some general ADF / Webcenter coding standards -
    http://umeshagarwal24.blogspot.com/2012/06/adf-coding-standards-check-points.html
    You can use JAudit as well as mentioned in the blog.

  • Wats the best practise for performance

    Hi all,
    In my out line i have 15 dimensions and for one dimension i have 39000 members so wat is the best practise for performance , If we have more dimensions and more meebers is there any problem for performance
    so wat is the best practise for dimensions and members??
    Thanks in advance??

    If it is ASO application it is not a problem.
    If it is a BSO application surely it will hit the performance.
    More dimensions will create performance issues.
    If the said 39000 members dimension is a Flat dimension. It will be another issue.
    If BSO is obvious try to split into two models.
    Create intermediate groupings for the Filat dimension.

  • What are the BEST books for Oracle database architect/designer?

    What concrete books would you recommend for OLTP database developer (to start from the scratch, starting from data sources analysis, logical and physical data modeling, indexes, tuning, maintaining). It doesn't have to be a book particulary for Oracle but suitable for it..
    I don't mean books DBA's or overall Oracle handbooks, also not for OLAP.
    Thanks!

    For learning how to use Oracle database effectively, i would say
    Tom Kyte's both books:
    Effective Oracle by design
    & Expert Oracle Database Architecture
    Jonathan Lewis's
    Practical Oracle 8i
    They tell you all the stuff: what/how to do something? and most importantly what/how not to do ?
    And their writing style is just awesome :)
    Amardeep Sidhu

  • Kindly suggest me the best video downloader for my ipad air

    suggest me the best app for the video downloading from the different websites

    You can't download files to an iPad.

  • Best Practises for doing Master Scheduling using SNP

    Hello Gurus ,
                         Can you please suggest the best practises for doing Master Scheduling using SNP . Which engine to use , what would that mean etc
    Regards,
    Nick

    APC Back-UPS XS 1300.  $169.99 at Best Buy.
    Our power outages here are usually only a few seconds; this should give my server about 20 or 25 minutes run-time.
    I'm setting up the PowerChute software now to shut down the computer when 5 minutes of power is left.  The load with the monitor sleeping is 171 watts.
    This has surge protection and other nice features as well.
    -Noel

  • Best Practice for Distributing Databases to Customers

    I did a little searching and was surprised to not find a best practice document for how to distribute Microsoft SQL Databases. With other database formats, it's common to distribute them as scripts. It seems that feature is rather limited with the built-in
    tools Microsoft provides. There appear to be limits to the length of the script. We're looking to distribute a database several GBs in size. We could detach the database or provide a backup, but that has its own disadvantages by limiting what versions
    of the SQL Server will accept the database.
    What do you recommend and can you point me to some documentation that handles this practice?
    Thank you.

    Its much easier to distribute schema/data from an older version to a newer one than the other way around. Nearly all SQL Server deployment features supports database version upgrade, and these include the "Copy Database" wizard, BACKUP/RESTORE,
    detach/attach, script generation, Microsoft Sync framework, and a few others.
    EVEN if you just want to distribute schemas, you may want to distribute the entire database, and then truncate the tables to purge data.
    Backing up and restoring your database is by far the most RELIABLE method of distributing it, but it may not be pratical in some cases because you'll need to generate a new backup every time a schema change occurs, but not if you already have an automated
    backup/maintenance routine in your environment.
    As an alternative, you can Copy Database functionality in SSMS, although it may present itself unstable in some situations, specially if you are distributing across multiple subnets and/or domains. It will also require you to purge data if/when applicable.
    Another option is to detach your database, copy its files, and then attach them in both the source and destination instances. It will generate downtime for your detached databases, so there are better methods for distribution available.
    And then there is the previously mentioned method of generating scripts for schema, and then using an INSERT statement or the import data wizard available in SSMS (which is very practical and implements a SSIS package internally that can be saved for repeated
    executions). Works fine, not as practical as the other options, but is the best way for distributing databases when their version is being downgraded.
    With all this said, there is no "best practice" for this. There are multiple features, each offering their own advantages and downfalls which allow them to align to different business requirements.

  • Liquid: What are the suggested best practises for multiple languages?

    Right now we are doing this:
    {% if globals.country == "EU" %}
    {% assign login = "Log in" %}
    {% assign userName = "Username" %}
    {% assign password = "Password" %}
    {% assign rememberMe = "Remember me?" %}
    {% assign confirmLogout = "You are now logged out!" %}
    {% endif %}
    {{login}} would output "Log in"
    Another thought would be to have it all in a string with commas and split it, like this:
    {% if globals.country == "EU" %}
    {% assign strings = "Log in;Username;Password;Remember me?;You are now logged out!" %}
    {% assign lang = strings | split: ";" %}
    {% endif %}
    {{lang[0]}} Would output "Log in".
    What are the best practises here?
    I would imagine either being slower than the other as well, maybe Adobe have some input?

    Hi Machinette,
    Use your first option in my opinion:
    A webapp where each item would contain a field for each language. i.e.  item 1 name login; en -> Log in; es -> Iniciar sesion. item 2 name logout; en -> Log iout; es -> Cerrar sesion....
    Here's an example of my multilingual web apps:
    FAQs:
    EN Question
    JP Question
    EN Answer
    JP Answer
    Testimonials:
    Title-NZ
    Title-JP
    Quote-Preview-NZ
    Quote-Preview-JP
    Quote-Full-JP
    How did you hear about us:
    Title_En
    Title_JP
    Multilingual Text:
    Text_En
    Text JP
    As you can see above, the items in the web apps form the different multilingual text - the different FAQs, the different Testimonials, the different Multilingual Text. The domain name needs to determine the language. Very important. And use a globals.site.countryCode to determine the language.
    The key is when you want to reference that item. I think Abhishek was onto it using JSON files, easy to select the text you want. If JSON files don't work, here's what you do:
    {module_webapps id="Multilingual Text" filter="i" itemId="4951580"}<!-- login -->
    {module_webapps id="Multilingual Text" filter="i" itemId="4951611"}<!-- Try Lesson 1 -->
    {module_webapps id="Multilingual Text" filter="i" itemId="4951612"}<!-- Join for free -->
    Else place everything into a collection, but I have hundreds of items, so I don't want to collect too many records. Only the ones I need per page.
    Finally, here's my code for one of the web apps, FAQs.
    {% assign countrycode = globals.site.countryCode -%}
    {% case countrycode -%}
    {% when 'JP' -%}
    <div class="faq-question">
        <h4>{{this['JP Question']}}</h4>
        <div class="faq-details">
            <div class="answer"><p>{{this['JP Answer']}}</p></div>
        </div>
    </div>
    {% else -%}
    <div class="faq-question">
        <h4>{{this['EN Question']}}</h4>
        <div class="faq-details">
            <div class="answer"><p>{{this['EN Answer']}}</p></div>
        </div>
    </div>
    {% endcase -%}
    http://www.samandmelenglish.com/faqs
    http://www.samandmelenglish.jp/faqs
    Hope this helps.
    Stephen - Fuel Design

  • Suggest me the best training institute for SAP CRM ABAP / CRM Technical

    Dear all,
    Kindly suggest me that, which training institute in India is providing training course specially on SAP CRM ABAP course.
    I am happy if any SAP CRM Technical expert willing to train me directly. I have good functional experience on CRM module and planning to be trained on technical part.
    Your recommendations will be highly appreciated.
    best regards
    Raghu ram

    user12483593 wrote:
    hi,
    i am looking for good training institution in india to learn oracle dba
    so pls can any one suggest me which institute providing the best training for this course
    thank you in advanceThe best training is probably by Oracle University
    Goto [http://www.oracle.com/education] - choose Product Courses, Database and Grids:
    (eg [http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=14&p_org_id=1080544&lang=US])
    In both cases ensure country selected on top right is India.
    On the schedule choose courses with +100% Student Satisfaction+
    It is hard, (though obviosly not impossible), for other institutions to better this standard of such courses.
    If you are aspiring to Oracle DBA OCP be very sure the institute you are choosing satisifies the requirements for the Hands on Course, and do not take the institutes word for it but check.
    It may well be that you are looking for institutions offering the WDP programme. This is a maximm of 6 hours/week over several weeks so IMHO is impractical if you do not live nearby. There appear to be comments that sometimes the training from these institutes doing the WDP course can be of very variable quality. Probably the only option here is to seek out the opinions of recent psat students you can trust.

  • SQL Server 2012 - Wat Is The Best Solution For Creating a Read Only Replicated/AlwaysOn Database

    Hi there I was wondering if someone may have a best recommendation for the following requirement I have with regards setting up a third database server for reporting?
    Current Setup
    SQL Server 2012 Enterprise setup at two sites (Site A & Site B).
    Configured to use AlwaysOn Availability groups for HA and DR.
    Installed on Windows 2012 Servers.
    This is all working and failover works fine and no issues. So…
    Requirement
    A third server needs to be added for the purpose of reporting, to be located on another site (Site C) possibly in another domain. This server needs to have a replicated read only copy of the live database from site A or Site B, whichever is in use. The Site
    C reporting database should be as up-to-date to the Site A or Site B database as possible – preferably within a few seconds anyway….
    Solution - What I believe are available to me
    I believe I can use AlwaysOn and create a ReadOnly replica for the Site C. If so do I assume Site C needs to have the Enterprise version of SQL server i.e. to match Site A & Site B?
    Using log shipping which if I am correct means the Site C does not need to be an Enterprise version.
    Any help on the best solution for this would be greatly appreciated.
    Thanks, Steve

    for always on - all nodes should be part of one windows cluster..if there site C is on different domain - I do not think it works.
    Logshipping works --as long as the sql on site C is is same or higher version(sql 2012 or above).  you can only do read only.
    IMHo, if you can make site C in the same domain then, Always is better solution else log shipping
    also, if your database has enterprise level features such as - partitonin, data compression -- you cannot restore the database on lower editions- so you need to have enterprise edition.
    Hope it Helps!!

  • What is the best practise to provide a text file for a Java class in a OSGi bundle in CQ?

    This is probably a very basic question so please bear with me.
    What is the best way to provide a .txt file to be read by a Java class in a OSGi bundle in CQ 5.5?
    I have been able to read a file called "test.txt" that I put in a structure like this /src/resources/<any-sub-folder>/test.txt  from my java class  at /src/main/java/com/test/mytest/Test.java using the bundle's getResource and getEntry calls but I was not able to use the context.getDataFile. How is this getDataFile method call to be used?
    And what if I want to read the file located in another bundle, is it possible? or can I add the file to some repository and then access it - but I am not clear how to do this.
    And I would also like to know what is the best practise if I need to provide a large  data set in a flat file to be read by a Java class in CQ5.
    Please provide detailed steps or point me to a how to guide or other helpful resources as I am a novice.
    Thank you in advance for your time and help.
    VS

    As you can read in the OSGi Core specification (section 4.5.2), the getDataFile() method is to read/write a file in the bundle's private persistent area. It cannot be used to read files contained in the bundle. The issue Sham mentions refers to a version of Felix which is not used in CQ.
    The methods you mentioned (getResource and getEntry) are appropriate for reading files contained in a bundle.
    Reading a file from the repository is done using the JCR API. You can see a blueprint for how to do this by looking at the readFile method in http://svn.apache.org/repos/asf/jackrabbit/tags/2.4.0/jackrabbit-jcr-commons/src/main/java /org/apache/jackrabbit/commons/JcrUtils.java. Unfortunately, this method is not currently usable as it was declared incorrectly (should be a static method, but is an instance method).
    Regards,
    Justin

  • Suggest the Best Practice for Procurement of Commodities like crude, copper

    Dear Gurus,
    Please suggest the best practice for following business Process.
    My client is having the procurement need for a comodity whose prices are fluctuating. Say Crude Oil . The prices are changing every day. Now The client would like to pay to vendor on day of good receipt. But it may be possible that the price on GR day is much higher. How to control these kind of procurement. Presently I have activated the price variance through invoice posting but this is not working.
    Can you suggest best practice for  procurement of comodities.
    Thank you for your consistant support.
    Regards
    Vinod Kakade
    Edited by: vinodkakade on Jul 14, 2011 2:34 PM

    Hi Vinod,
    Would you know the price by the time the GR is to happen, in this case you can ask the vendor to send the confirmations, just prior to that with the correct price.
    Please refer this link
    Change in PO Price after goods receipts and goods issue
    though the thread is marked unanswered.
    Regards
    Shailesh

  • 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's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    What's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    The best cover is the one that suites your needs. Try Google. There are dozens on the market.
    As for the Apple Smart Cover, it does work with the new iPad. There are a few reported issues with it, but that doesn't come close to representing the totality of folks with it.

Maybe you are looking for

  • Pixel Aspect Ratio Issues-FCP HELPP!!!

    Okay folks, so currently I am putting together my reel in FCP, however I am encountering a few issues. So my source formats are different in pixel aspect ratio, some was shot on the 7D, some on the Alexa, and some on super 16mm, and a few after effec

  • Can i make an external button to power up the computer using wake up on lan?

    With the feature of Wake up on Lan I am assuming that the computer can be shutdown completly but via wake up on Lan? If this is the case I have my mac pro hidden from sight but obviously need to turn the computer still. I do not want to use the Sleep

  • Problem in updating to the database with JBoss

    Hi, We have created a datasource in JBoss to connect to a certain database. The data source works fine when retrieving the data from the database but fails when we try to update or insert the data. Below is part of the error trace: Caused by: javax.n

  • Quickbooks printing issues

    After working fine for over 2 years, suddenly I cannot print or create PDF's from Quickbooks. I trashed prefs, no improvement. I deleted all QB relatedd software and reinstalled QB Pro 6.0, again no improvement. Finally I downloaded the trial version

  • I've updated my iphone 4S to iOS 5.1 recently and I've found some problems.

    First, it drains my battery. It drops 15% in an hour even though I don't use it. Second, when I click the "Edit" button for photos, my iphone shuts down automatically and turns on again. I can't edit any photos! Third, I can't click the "Camera" butt