How To Question: Can I fetch a row from database and show it as link,on click of thi

Hi:
I am trying to get a row set from database, display it as link/ hotspot then upon clicking of this link to delete that particular row from the database.
I would appreciate if someone there could give some pointers.
Thanks in Advance
Ajith
null

In each row of your table, you need to construct a HREF that submits to a servlet (or JSP) with a GET parameter that references the primary key for that row, e.g.
<td><a href="delete.jsp?rowid=15">Delete</a></td>The delete.jsp can execute the delete and then forward to the display.jsp to redisplay the resultset after requerying the database.
John H.

Similar Messages

  • To fetch XML files from database  AND regarding barcodes

    Hi !!
    I am very new to this forum...this is my first mail to this forum...
    1.) Actually I would like to know how to fetch XML files from database and then how to get the datas from that XML files???Right now i am using struts frame work...If u anyone send some sample code for this one,it is Very helpful for me.....
    2.)Using java ,how to generate Barcodes?In database I have Some serial number.While I try to display the serial number in Front end ,I should display with Barcode Corresponding to that number.Plz send some sample codes if u have.....
    Thanks in ADVANCE,

    PonJAVA wrote:
    Hi !!
    I am very new to this forum...this is my first mail to this forum...
    1.) Actually I would like to know how to fetch XML files from databaseStart with a JDBC tutorial. Check out DAO Pattern and Hibernate as well.
    and then how to get the datas from that XML files???Google Java & XML (there are many ways to do this
    Right now i am using struts frame work...Okay...
    If u anyone send some sample code for this one,it is Very helpful for me..... You haven't provided any detail regarding your task so there's no way anyone could post code for you.
    2.)Using java ,how to generate Barcodes?Search Google
    In database I have Some serial number.While I try to display the serial number in Front end ,I should display with Barcode Corresponding to that number.Plz send some sample codes if u have.....Try a JSP/Servlet tutorial.

  • How can i get the data from database & add them as a link

    Hi,
    how can i get a data from a database(DB2) and that data will be having a file so i should make them as a link.i tried it in jsp .
    <%
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");     
    response.setContentType("text/html");
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:db2:spintran");
    Statement stmt = conn.createStatement();
    stmt.executeQuery("set current schema tut");
    ResultSet rs = stmt.executeQuery("select * from tutorial");     
    %>
    Type Of the Category : &nbsp&nbsp&nbsp
    <%
         while (rs.next())
         String desc = rs.getString(1);     
         out.println(desc);
    %>
         <A HREF = "<%=desc%>"><%=desc%> </A>
         <%
         %>
    but it is not working.how can i link.
    thank you.

    what is desc? is it the file name ? whats the data type of desc in db? INFILE?
    if desc is just the name of the file, then make sure that such a file exists in the proper folder.only then the link works..
    that is, if desc is 'a.jpg' then a.jpg should be existing in the same folder as your html is.

  • How to persist data in the object n memory after fetching it once from database and use it with linq

    Hi,
    I have some data from the database around 8 to 10 records .
    These records are interrelated and I need to show cascade drop down.
    I want to get the records from the database using c#.
    And then based on certain events on the page want to use linq over the same data without having to get the data from the data base again.
    i.e 
    ProductName
    Product Plan
    Product type
    Monthly
    Annually
    pordA
    Gold
    Individual
    1
    5
    pordA
    Gold
    Spouse
    2
    6
    pordA
    Silver
    Individual
    3
    7
    pordA
    Silver
    Spouse
    4
    8
    Prod B
    Platinum
    Individual
    5
    9
    Prod B
    Platinum
    Spouse
    6
    10
    Prod B
    Gold
    Individual
    1
    5
    Prod B
    Gold
    Spouse
    2
    6
    pordA
    Silver
    Individual
    3
    7
    pordA
    Silver
    Spouse
    4
    8
    pordA
    Platinum
    Individual
    5
    9
    Now on page load I want product name in drop down.
    Based on the productName selected i want to show Product Plan in another drop down and based on prduct plan want to show prduct type in drop down and then the annual and monthly in drop down.
    I want to get all the records of  prod A and then using  linq to object  load the drop downs instead of running query to database.
    How can I keep the records available across the function calls.
    Regards
    Vinod

    This is mostly a ASP.NET question. You get better answers if you post it in ASP.NET forum.
    This is my answer:
    Session is not a suitable choice, since each user will have a duplicate of the data. Cache is a better option.
    You can put something in Cache option and retrieve it from Cache similar to using Session. This is the manual method of caching and management of the cache content is on yourself.
    public List<Product> GetAll()
    List<Product> products = null;
    if (Cache["Products"] == null)
    DataSet data = RetrieveProducts();
    products = ConvertProductsDataSetToObject(data);
    Cache.Insert("Products", products, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
    else
    products = (List<Product>)Cache["Products"];
    return products;
    When putting something in the cache, you should set its expire time. But one thing that is more important over this is to clear the cache when your data is changed in the data store (e.g. database).
    public void UpdateProduct()
    // update product in the database
    // clear the cahce, so that the next request for Products, receives a fresh copy of the data
    Cache["TestItem"] = null;
    Other than using cache manually, there are also some helper funcationalities that manage cache automatically for you, based on the technology you use (ASP.NET Web Forms or ASP.NET MVC). For example in ASP.NET Web Forms you can ask ASP.NET Web Forms engine
    to cache the output of a User Control automatocally by adding OutputCache directive to the user control. In ASP.NET MVC you can you [OutputCache] attribute and apply it to actions.
    [OutputCache(Duration = 86400, Location = OutputCacheLocation.All)]
    public ActionResult Index()
    var model = ProductBL.GetAll();
    return View(model);
    Also, there is a concept named cache dependency, by which you can specify a dependency for the item being cached. When the condition is met, the cache automatically invalidates and clears.
    There are three kinds of cache dependency:
    Item dependency: make cached data dependent on another cached data
    File dependency: make cached data dependent on a file
    Sql dependency: make cached data dependent on the result of a SQL query

  • Fetch Blob image from database and save in file

    Hi,
    I am using the following code to fetch a picture stored in database (blob type)
    $sql = "SELECT PICTURE FROM NEW_PICT WHERE SR_NO = 1";
    $stid = oci_parse($conn, $sql);
    oci_execute($stid);
    if(OCIFetch($stid)) //if file exists
    $a=OCIResult($stid,"PICTURE");
    file_put_contents('pics/test.jpg', $a->load());
    The code works fine with no errors and it generate the picture "test.jpg". The image also opens in windows image viewer.
    But when I try to open this image with Photoshop or any other image editing tool, the error occur "Invalid JPEG Marker" or "Invalid File Type"
    Also the image dose not display in browser.
    Please help.
    Thanks

    Make sure you fetch it as a BLOB.
    See "Uploading and Displaying an Image" on p 236 of The Underground PHP and Oracle Manual | Homepage

  • HOW TO DELETE THE ROW FROM DATABASE

    hI,
    Iam pasting my code below.My problem isi retrieve rows from database and display them in jsp page in rows.For each row there is delete hyperlink.Now when i click that link i should only delete the row corresponding to that delete link temporarily but it should not delete the row from database now.It should only delete the row from database when i click the save button.How can i do this can any one give some code.
    thanks
    naveen
    [email protected]
    <%@ page language="java" import="Utils.*,java.sql.*,SQLCon.ConnectionPool,java.util.Vector,java.util.StringTokenizer" %>
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Item Details</title>
    <script>
    function submitPage()
    document.details.action = "itemdetails.jsp" ;
    document.details.submit();
    </script>
    </head>
    <body>
    <form name="details" action="itemdetails.jsp" method="post">
    <%
    ConnectionPool pool;
    Connection con = null;
    Statement st;
    ResultSet rs =null;
    %>
    <table border="0" cellpadding="0" cellspacing="0" width="328">
    <tr>
    <td width="323" colspan="4"><b>Reference No :</b> <input type="text" name="txt_refno" size="14">
    <input type="submit" value="search" name="search" ></td>
    </tr>
    <tr>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item Code</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item No</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Amount </b></font></td>
    <td width="80" bgcolor="#000099"> </td>
    </tr>
    <%
    pool= new ConnectionPool();
    Utils utils = new Utils();
    double total =0.00;
    String search =utils.returnString(request.getParameter("search"));
    if(search.equals("search"))
    try
    String ref_no =utils.returnString(request.getParameter("txt_refno"));
    String strSQL="select * from ref_table where refno='" + ref_no + "' ";
    con = pool.getConnection();
    st=con.createStatement();
    rs = st.executeQuery(strSQL);
    while(rs.next())
    String itemcode=rs.getString(2);
    int item_no=rs.getInt(3);
    double amount= rs.getDouble(4);
    total= total + amount;
    %>
    <tr>
    <td width="81"><input type=hidden name=hitem value=<%=itemcode%>><%=itemcode%></td>
    <td width="81"><input type=hidden name=hitemno value=<%=item_no%>><%=item_no%></td>
    <td width="81"><input type=hidden name=hamount value=<%=amount%>><%=amount%></td>
    <td width="80"><a href="delete</td>
    </tr>
    <%
    }catch(Exception e){}
    finally {
    if (con != null) pool.returnConnection(con);
    %>
    <tr>
    <td width="323" colspan="4">
    <p align="right"><b>Total:</b><input type="text" name="txt_total" size="10" value="<%=total%>"></td>
    </tr>
    <tr>
    <td width="323" colspan="4">                   
    <input type="button" value="save" name="save"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    You mean when you click on the hyperlink you want that row to disappear from the page, but not delete the row from the database until a commit/submit button is pressed?
    Personally, I think I'd prefer that you have a delete checkbox next to every row and NOT remove them from the display if I was a user. You give your users a chance to change their mind about their choice, and when they're done they can see exactly which rows will be deleted before they commit.
    You know your problem, of course, so you might have a good reason for designing it this way. But I'd prefer not removing them from the display. JMO - MOD

  • Cannot fetch a row from OLE DB provider "BULK" with bulk insert task

    Hi, folks:
    I created a simple SSIS package. On the Control Flow, I created a Bulk INsert Task with Destination connection to a the local SQL server, a csv file from a local folder, specify comma delimiter. Then I excute the task and I got this long error message.
    [Bulk Insert Task] Error: An error occurred with the following error message: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.".

    I got the same error with some additional error details (below).  All I had to do to fix the problem was set the Timeout property for the SQL Server Destination = 0
    I was using the following components:
    SQL Server 2008
    SQL Server Integration Services 10.0
    Data Flow Task
    OLE DB Source – connecting to Oracle 11i
    SQL Server Destination – connecting to the local SQL Server 2008 instance
    Full Error Message:
    Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E14  Description: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E14  Description: "The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E14  Description: "The Bulk Insert operation of SQL Server Destination has timed out. Please consider increasing the value of Timeout property on the SQL Server Destination in the dataflow.".
    For SQL Server 2005 there is a hot fix available from Microsoft at http://support.microsoft.com/default.aspx/kb/937545

  • How to clear rows from iterator and re-fetch fresh data from the table ?

    Hi,
    I am using JDev 11.1.1.2.0
    I have generated JPA Service Facade and by using it, I have created Data Control which finally I have dragged & dropped on my .jsff file.
    In viewObject, there is a method clearCache() to clear the viewObject data.
    Iterator has also one method clear() but when it invoked, ADF framework throws StackOverFlow error.
    So, I want to clear my iterator before calling executeQuery() method.
    How Can I clear it ?
    Because In my case if I run executeQuery() method on DCIteratorBinding, it is not getting updated with the lates value from DB table.
    So I want to clear all the rows from iterator and then want to call executeQuery() method to updated latest data from DB tables.
    I have also tried below peace of code to refresh iterator but still iterator getting updated with two same rows () while in DB it is proper.
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb =
    fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer iteratorbindings =
    (DCBindingContainer)dcb.getValue(fctx);
    DCIteratorBinding dciter =
    iteratorbindings.findIteratorBinding(<iteratorname>);
    dciter.releaseData();
    dciter.executeQuery();
    dciter.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED);
    regards,
    devang

    Hi,
    Have you try to drag and drop to your refresh or query button an "Execute" operation from the Data Control Pallete?
    We are using JPA/ EJB Session Beans and that works for us.
    regards,
    pino

  • Problem "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider for linked server"

    hi
      i'd like to ask question about linked server.
      my linked server used to work but now when i try to select from linked server i was told "The OLE DB provider for linked server reported an error. The provider reported an unexpected catastrophic failure Cannot fetch a row from OLE DB provider
    for linked server"
      but in fact for test connection i was told "the test connection to the linked server succeeded".
      could  anyone help me? thank u very much
    best regards
    martin

    Hi, 
    In addition to Tracy's post we have to know those answers as well:
    * what provider are you using for the connection
    * what do you connect to
    for example, if someone try to connect to oracle using sql server provider then several simple queries are going to work probably OK, but once you are trying to use T-SQL or any complex SQL query then the errors are starting.
    please post the connection string (without the password!) + the query that you are trying to use.
    [Personal Site] [Blog] [Facebook]

  • How many domains can share a single set of database repository schemas?

    How many domains can share a single set of database repository schemas (created by the RCU)?
    What is the best practice in an environment with many domains/WLS servers/applications and a desire to manage minimum database MW repository schemas?

    Hi,
    You can't share the same repository for multiple domains.
    http://docs.oracle.com/cd/E23943_01/web.1111/e13716/understand_domains.htm#i1102627
    (Please mark question as answered or helpful)
    Arik

  • How can I send a message from database to a J2EE application?

    How can I send a message from database to a J2EE application?
    If I have a codetable in database that has new or modified values I have to refresh the codetable in my J2EE application.
    Most effective way would be send a message to initiate a table reload from J2EE app, but I don't know how to do this.
    Now I have a background thread that regular reads the table and looks for changes.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • HT201269 I have new iphone and all data were restored but my music! How can I add my music from Itunes and new iphone?

    I have new iphone and all data were restored but my music! How can I add my music from Itunes and new iphone?

    Connect the old phone to your computer, right click on it in iTunes, and choose Transfer Purchases. That should put all of your music in iTunes except any tracks that were not purchased from iTunes. If you have any such you will have to retrieve them from the original source, or see: https://discussions.apple.com/docs/DOC-3141.
    Apple also has this tip for copying data from an old phone to a new one.

  • How come I can't export a image from lightroom 3 that is 600w x 610h?

    How come I can't export a image from lightroom 3 that is 600w x 610h?

    I think thats what I'm doing.  No luck though. Maybe its a bug?

  • How to select rows from database like 10 to 20 etc

    Hi Experts,
    I want to select rows from database like row number 10 to row number 20.How could it be done?

    HI,
       First get the data into the INTERNAL TABLE from the FLAT FILE and read the internal table using the index.
        ex: 1) Read table ITAB index 10.
              2) Read table ITAB index 20.
    or use as said by  Srinivas Gurram, to get the range of records using where condition to the loop.
    <REMOVED BY MODERATOR>
    Edited by: Ravi Kumar on Jun 9, 2008 4:01 PM
    Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:16 PM

  • How can I extract the soundtrack from iMovie and put it in my iTunes Library?

    How can I extract the soundtrack from iMovie and put it in my iTunes Library?

    Or this
    From iMovie 10.0.6 select Share > File. Then select Format=Audio Only. Then select File Format and choose from AAC,MP3,AIFF or WAV.

Maybe you are looking for

  • Safari won't open on my Mac

    For some reason I am totally unable to use Safari on my MBP. When I click the icon it bounces as it normally does and then stops with the little light underneath it on, which I suppose signifies that the program is actually running. That's all that h

  • Calculating value based on parent/child relations for a column..

    Hi Friends, I have a requirement thus, sample table, parts, ppart cpart qty 990 1234 200 100 100_1 150 100 100_2 2 100_1 120 100 100_1 121 200 100_2 130 50 where qty is a number and the rest are varchar fields. Here the ppart 100 is a parent value fo

  • Places doesn't show up for geo-tagged photos from phone (Sony Ericsson)

    So I have a Sony Ericsson T715, which has triangulation geo-tagging for photos, I can see their location through the phone no problem. However, when I import them via the Bluetooth File Browser to my Mac and import them into iPhoto '09, their locatio

  • Purchase requisition's Workflow :

    Hi all, i must implement the standard workflow for purchase requisition, i use the number 20000077 - Workflow for overall release of requisition. I would like to know if it's possible to have many responsibles for a code release in release strategy o

  • Is there a Video eMail program for the eMac?

    I have an external video camera hooked up to my eMac and would like to use it for Video Emails. On the PC's there are several free programs, including iGoogle and MS Messenger that allow this. Yet when I try to use them on the eMac, they state they a