Web Page and Database Design Problem

Ok, so I'm trying to develop an app, but am having a few problems and need some advice/help.
I have a webpage made up of jsp pages. These pages will contain forms that will either list info from the databse, or allow users to enter data to submit to the DB.
So I will have Servelts that will process the form information.
I also have written DAO interfaces for different tables. For example I have a config table which olds keys and there values.
This information will only ever be displayed so I have an interface which getAll() and get(String key).
I want to avoid putting code like below going into the DAO
ctx = new InitialContext();
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup (dataSource);
conn = ds.getConnection();
PreparedStatement stmt = conn.prepareStatement(query);
ResultSet records = stmt.executeQuery();
I'd prefer to make calls from my DAO getAll() method to another class which would create the connection, and query the db, and return the ResultSet, so that I can store/manipulate it anyway I wish, before passing the results back to the servlet.
Problem is the records seem to come back null!

ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup (dataSource);
conn = ds.getConnection();You should have a Connection Pool to create a connection and hand it out to whoover ask for it.
Check out Hibernate
Hibernate can manger your connection (you need to set the xml configuration first) .. It's another layer to encapsulate your JDBC connection, request, etc..
Also check out Spring Framework. Spring can makes Transaction much more easy to implement (using aspect)
It provides a handful of useful api for you to work with. like JdbcTemplate, HibernateTemplate.

Similar Messages

  • HT4922 Downloaded 5.1.1. to my iphone. Now, Safari will not connect to my server.  Can not download web pages and many of my apps. Running very slow sluggish! Is there a fix? Sound like other users are experiencing same problems.  Anyone have a solution?

    Downloaded 5.1.1 to my iphone. Now, Safari will not connect to my server. Can not download web pages and many of my apps. Email seems to be ok. iphone running slow and sluggish.  I have read several other users have experienced the same problem. Any solutions?

    Basic troubleshooting steps oultlined in the User Guide are restart, reset, restore from backup, restore as new device.
    You need to go through all steps in succession until your problem is solved.  If going through ALL these steps fails to resolve your issue, then you'll need to bring your phone into Apple for evaluation and possible replacement.

  • IPad won't copy text from web page and paste in email

    I'm trying to copy text from a web page, and when I paste it in Note or in a new email, it copied the web page link, not the text. Doing this in iPad.  What am I doing wrong? Thanks

    I think it depends on what you are trying to copy.
    To copy, put your finger on the text and hold until the copy thing shows up.  Adjust the size to whatnyou want, then touch copy.( I know, you already knew that).  To paste, touch the screen where you want it to go until the paste thing shows up.
    I just did it
    glass, metal and minimalist design. Two.    ( pasted from a web page)
    Some pages are set up so that you cannot copy words or images.
    So try a different page to see if you are doing it right.   
    If you want, post the link to the page and we call all try it as well.

  • Dynamic web pages and Access

    I am starting to work on some dynamic web pages to upload
    information to an Access 2003 database using ASP. What I would like
    to do is to give the user a chance to review their information
    before it actually gets sent to the database. That is to say, after
    they fill out the form on the dynamic web page, and click a submit
    button, I would like to bring up a new page with their info
    summarized and give them the chance to review it and/or go back and
    make changes before it actually gets written to the database. Any
    suggestions would be appreciated!

    I'm not sure what the question is. It sounds like you already
    know what you want.
    Have the form post to an asp page that retrieves the form
    values and displays them in the format you want. Give them the
    choice to go back and make changes or submit. The second page can
    also be a form that you dynamically populate from the first page
    values.
    I'm not really sure what the benefit of this is. Why do the
    users need a different page to review what they input from the
    original page? What added value will there be?

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • Have emails sent directly to a web page for database logging?

    I would like to have an email that is sent to an email address, actually be processed by a coldfuson page and inserted into my database. What's the technique behind that. Kind of like when people send videos to youtube from a cell phone. I want emails sent to me to be processed by a web page and stored in my own database. Thanks

    Use the cfpop tag to retrieve yor e-mail messages. For example,
    <cfpop
    server = "mail.myMailDomain.com"
    action="getAll"
    name="myMessages"
    username = "bkbk"
    password = "bkbk001">
    <cfdump var="#myMessages#">
    <!--- insert code to save the messages to the database --->

  • Internet explorer 11 missing letters on web page and can't type in a search

    Windows 10 preview installed
    Internet explorer 11 missing letters on web page and can't type in a search

    I just got a call about this exact issue today!
    The person is at a Marriott hotel which uses some type of company called STSN for their internet connection via both Ethernet and Wifi.
    http://www.stsn.com/home.html
    I'm waiting for them to call me back after trying every trouble shooting step I could think of. My only guess now is that it's Safari's pop up blocker blocking some kind of navigation or log-in window. I'm going to tell them to turn off pop-up blocker menu choice next.
    After that it's turning off Java and Javascript to see if the have any affect.
    Btw, they're experiencing this propblem on a TiBook G4. Also tried a new user account and two other pre-existing accounts but all had the same issue. Both with Ethernet and WiFi the problem remained.
    Too many to list   Mac OS X (10.4.8)  

  • My ipad air is slower loading web pages and opening apps than ipad 2

    Bought new ipad air a month ago, it seems very slow compared to my ipad 2, when loading web pages and apps, is anyone else having these problems or have I got a faulty ipad?

    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing will be reset

  • How can I use Automator or AppleScript to get text from a web page and paste it in execl?

    I don't know how to make scripts or complexed automator workflows... that's why I'm asking.
    I'm trying to make a simple app or script to ask me what text to extract from a web page, like name, address and phone number of a web page and paste each one of these data in the righ cell of excel.
    I was thinking to promt a request from automator or an applescript to ask me which text to extract from the page or to look throught the HTML of the page to search for specific html tags, from which extracting text and then importing it, or paste it to the specified execl cell. Name in the name cell, address in the address cell and so on.
    Can somebody help me to make this script?
    If you know an alternative, like a software that already do this or another language to use, please tell.

    Try holding down the alt key as you mark the text to be copied. You can then copy columns to table text.

  • 1. How can we search the Forum to see if a question has already been asked? 2. Can I send a Web Page and not just its Link?

    1. How can we search the Forum to see if a question has already been asked? Search goes back to Help and out of the Forum.
    2. Can I send a Web Page and not just its Link? Explorer allows it.

    1. How can we search the Forum to see if a question has already been asked? Search goes back to Help and out of the Forum.
    2. Can I send a Web Page and not just its Link? Explorer allows it.

  • When I am in safari, I try to bookmark a web page and it is not doing it, it worked before I updated to the ios6 version

    When I am in safari, I try to bookmark a web page and it is not doing it, it worked before I updated to the ios6 version, does any one know why ? It pulls up the screen to save it but then it is not showing up on the bookmark drop down menu, it continues to show the standard google,iPad user guide, yahoo....

    hello sofg777, when you're at a page you want to print try to press ctrl+P and select a different printer than the Microsoft XPS Document Writer which seems to be set as your default printer in firefox at the moment.

  • Want user to click on pic from my Web page and for it to enlarge in awindow

    I've uploaded my pic from iPhoto and placed in on my page in iWeb. I want the user to be able to click on the pic on my web page and for the page to "enlarge" so the user can see it better. Possibly in a new window.
    Is this possible in iWeb?

    There are a couple of ways. See my demo pages Fancy Zoom and Opening Item in New Specially Sized Window. Both will do what you want. The code uses is also described.
    OT

  • Search static pages AND database tables

    Hi,
    I'm working on a project in which I have static content
    pages, plus I'm creating a set of dynamic pages that display jobs
    and events listings etc. The dynamic pages are going to run off an
    access database.
    I'm need to create a search facility on the site. At present
    I'm planning to use a drop down box (or radio buttons ?) to allow
    the user to select which part of the site to search (main site,
    jobs or events), the selection will determine which search page the
    form query is passed to (site text search or database query search
    page).
    Am I approaching this correctly.
    Can anyone comment on possibly a better or alternative way of
    providing such a search option ? (searching both static pages and
    database tables)
    Thanks in advance.

    I guess something like <cffile action="read"
    file="C:\docs\shopping.html" variable="shoppingList">. Is there
    a way to do multiple files at once?

  • Difference between Web pages and journal

    I cannot really pin down the difference between a web page and a web journal in Aperture 2. Any ideas? I'm sure it is obvious but I'm dumb today.

    Here's a sample of a travelogue done with the Journal mode:
    http://ianjameswood.co.uk/ptm-luzern/report/
    Watch out, it's 17 pages long...
    Ian

  • Whenever I open firefox a add ons screen comes up with the yahoo web page behind it. . I just want the Yahoo web page and do not want to close the add ons page every time I use my computer.

    Whenever I open firefox a add ons screen comes up with the yahoo web page behind it. . I just want the Yahoo web page and do not want to close the add ons page every time I use my computer.
    I don't know what else to say about this. It is a screen that comes up in its own window everytime I open Firefox

    Please check your home page setting and see if about:addons is listed. If it is, please remove it
    https://support.mozilla.com/en-US/kb/How+to+set+the+home+page

Maybe you are looking for

  • Help with PDF in Reader please

    I hve Windows XP and Reader 9 and I  am trying to fill in a PDF form that according to the secutity settings shows that the fields allow filling but no signature.  I tried using tools but it says "only available when document rights are available". 

  • Reading from file where file name is not exactly known.

    Hi, I have to read a file using utl_file. But the file name is not exactly known. The file name would be of the syntax uplldr_XXXX.CSV , where XXXX can be any thing like 1234. so file name would be uplldr_1234.csv in that location. How can I search t

  • I used the drawing option in AppleWorks. What is an equivalent program/option for Lion?

    I used the drawing option in AppleWorks. What is an equivalent program/option in Lion? I use it to design quilts.

  • Starting essbase failing with Fatal Error: Incorrect number of users found

    In an OVM setup env on B16, $ /u01/APPLTOP/instance/BIInstance/bin/opmnctl startall opmnctl startall: starting opmn and all managed processes... ================================================================================ opmn id=adc2111145.us.or

  • Need help please wrt54g ver. 2

    I came home from lunch today and went to get on xbox live and got no internet connection so i called COX (my isp) and when I hardwired my laptop directly to the modem my internet worked fine.  Now, I run both of my pcs wirelessly and have my xbox har