Deleting problem in database

i hav to jsp page
one is to view which data should delete
and the another jsp is to tel it is deleted or not
i am getting error in second jsp page
here is my first jsp page
<html>
<head>
<title>Delete an Project Record</title>
</head>
<%@ page language="java" import="java.sql.*"%>
<body bgcolor=LightBlue>
<h1>Delete an Project Record</h1>
<table border="1" width="400">
<tr>
<td><b>Project Id </b></td>
<td><b>Project Name </b></td>
<td><b>Client Name </b></td>
<td><b>Project Start Date </b></td>
<td><b>Estimated End Date</b></td>
<td><b>Project Manager </b></td>
<td><b>Estimated Effort </b></td>
<td><b>Delete? </b></td>
</tr>
<%
               Connection con = null;
               Statement stmt = null;
               ResultSet rs = null;
               String driverName = "com.mysql.jdbc.Driver";
               Class.forName(driverName);
               String serverName = "192.168.10.5";
               String mydatabase = "Trainees";
               String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
               String username = "josep";
               String password = "josep";
               con = DriverManager.getConnection(url, username, password);
               stmt=con.createStatement();
               rs=stmt.executeQuery("select * from project");
                                            if(rs != null)               
               while (rs.next())
               String Project_id  = rs.getString ("proj_id");
               String Project_name=rs.getString ("proj_name");
                        String client_name=rs.getString ("client_name");
               String start_date=rs.getString("strt_date");
               String estimated_date=rs.getString("est_date");
               String Project_mgr=rs.getString ("proj_mgr");
               int est_effort=rs.getInt ("est_effort");
%>
<tr>
     <td><%=Project_id %></td>
     <td><%=Project_name %></td>
     <td><%=client_name %></td>
     <td><%=start_date %></td>
     <td><%=estimated_date %></td>
     <td><%=Project_mgr %></td>
     <td><%=est_effort %></td>
     <td><a href='delproc.jsp?Project_id=<%=Project_id %>'>delete</a></td>
</tr>
<%
                 stmt.close();
                     con.close();
%>
</table>
</form>
</body>
</html>
here is my second jsp page<html>
<head>
<title>Delete Project Processing</title>
</head>
<%@ page language="java"import="java.sql.*"%>
<body>
<%
               String driverName = "com.mysql.jdbc.Driver";
               Class.forName(driverName);
               String Project_id =request.getParameter("proj_id");
               String serverName = "192.168.10.5";
               String mydatabase = "Trainees";
               String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
               String username = "josep";
               String password = "josep";
               Connection con = DriverManager.getConnection(url, username, password);
Statement stmt=con.createStatement();
int rowsAffected = stmt.executeUpdate("delete from project where proj_id=" + Project_id);
if(rowsAffected == 1)
%>
<h1> Successful Deletion </h1>
<%
else
%>
<h1> Sorry, Deletion has failed </h1>
<%
stmt.close();
con.close();
%>
</body>
</html>
and i am getting the result as sorry deletion has failed
plz tel me wer is the error

i am not getting error
the next jsp page shows that sorry no deletion
can u check n tel me

Similar Messages

  • Delete all the database table content

    Hello Friends,
    I have a z table with 5 fields (all the key fields) and I want to delete all the table content and load fresh content from internal table.
    I tried using syntax 'delete ztable' but sy-subrc value is coming as 4, means no table content is getting deleted.
    Please suggest me any alternative way to delete all the database table content.
    Thanks in advance,
    Shreekant

    Hi,
    try using
    delete from ztable.
    This will delete all records from your ztable. After this command u can fill your ztable from itab by the following command
    select *
    from std table
    into corresponding fields of itab.
    insert ztable from table itab.
    Hopefully this will solve your problem.
    Regards,
    Ibrar

  • TaskInstance Deletion problem

    I am getting a strange problem with the taskinstance deletion.
    When I am trying to delete the taskinstance by clicking the taskitem and hit delete it is giving me unknown <TASKITEMID>.
    When I listed all the taskinstances from the debug page and click on delete it displayed the message that it is deleted but when i am again listing the taskinstace from the debug page it is listing the same.
    I directly went into the server and deleted the taskinstace from the lh console but still it is showing up in the taskinstances.
    Any idea why this could happen.

    A simply way for dev env. go to idm debug page, from bulk delete list, select "task instance". Keep in mind, this action will delete all active tasks from IDM.
    If you have concern about deleting all active tasks, you probably need SQL to delete it from database obj table manually.

  • SDB - delete problem/solution

    Hi Experts.
    Is it possible to delete problem/solution from solution database? There is information in help that it is not possible to delete problem/solution, but that they can be archived.. But note 946030 says it is not available...
    Regards
    Piotr

    Hello Piotr,
    In version 4 it was released one note (730402) that allow us to delete some symptoms and solutions. However, this may lead into some inconsistencies if they're linked with documents. We've never tried to execute it.... but if this may help you, try it
    Kind regards,
    Bruno

  • Interactive report performance problem over database link - Oracle Gateway

    Hello all;
    This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
    The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
    query like this: (due to sensitivity issue, I can not disclose real table name)
    SELECT apex_item.checkbox(1,b.col3)
    , a.col1
    , a.col2
    FROM table_one a
    , table_two b
    WHERE a.col3 = 12345
    AND a.col4 = 100
    AND b.col5 = a.col5
    table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
    Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
    I would like to get ideas from people how to resolve or speed-up the query?
    Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
    Thank you.
    Shaun S.

    Hi Shaun
    Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
    By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
    Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two),
    sourceqry AS
    (SELECT  b.col3 x
           , a.col1 y
           , a.col2 z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5)
    SELECT apex_item.checkbox(1,x), y , z
    FROM sourceqry
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two)
    SELECT  apex_item.checkbox(1,x), y , z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
    We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
    Sorry for all the questions but it helps to answer the question, if I can.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Check "Problem: Oracle Database 10g Release 2 can only be installed in new

    Hi All
    Installing 10g software on AIX Box in /oracle/oraHome2,where oracle9i is already installed in /oracle/oraHome1 and oracle inventory is in /oracle/inventory
    In product specific prerequisite screen I am getting the
    check:Oracle Home incompatibilties is failed I am getting the error
    Check complete. The overall result of this check is: Passed
    =======================================================================
    Checking for Oracle Home incompatibilities ....
    Actual Result: Oracle9i Database 9.2.0.1.0
    Check complete. The overall result of this check is: Failed <<<<
    Problem: Oracle Database 10g Release 2 can only be installed in a new Oracle Home
    Recommendation: Choose a new Oracle Home for installing this product
    though I am installing it in different oracle homes why i am getting this error?
    Is it because 10g installation is picking the same oracle inventory /oracle/inventory
    do i need to make different oracle inventory for different oracle homes???????plz confirm..is thats the reason i am getting this error??????
    Thanks inadvance
    Gagan

    I figure out you are trying to install 10gR2 on top of an existing 9iR2 Oracle Home. This is corrected at the Path definition window. Most probably you just click on the <Next> and by default the 9iR2 Oracle Home was selected. You must define a new oracle home for the 10gR2 install.
    ~ Madrid

  • Problem with database schema objects in the entity object wizard

    Hi All,
    When creating a new entity object, I am facing a problem with database schema objects in the entity object wizard, database schema objects (check boxes for tables,synonyms...) are disabled. Actually I am using a synonym but I am not able to select the synonym check box.
    Can any of you folks tell me how to enable the database schema objects (check boxes for tables,synonyms...).
    Thanks in Advance.
    Raja.M

    Make sure your using rite version of jdeveloper..
    Make sure your using apps schema and check whether your able perform DML operations in the schema vis sql developer.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • Two Related (?) file deleting problems in Finder and Time Machnine

    My internal drive is partition into two volumes. In the second one (the "non-boot" one), I was have trouble putting files in the trash that were locked. As I was tracking that down I coincidentally(?) started having another problem.
    I started getting a message that the files being put into the trash must be deleted immediately. I check permissions and I had read/write Privileges in the user account I'm normally logged into. However, If I logged into my administrator account, I could put things in the trash without deleting them. I noticed that ignore ownerships wasn't checked, so I checked that.
    That allowed my to put files into the trash without immediately deleting them. I went ahead and deleted the files I wanted to get rid of. However, I'm wondering if there was another issue because I am lead to understand that the ownership privileges shouldn't have necessitated checking "ignore ownerships"?
    Also, I had trouble deleting the backups of those files and folders in time machine. I can delete most of it. But for one folder (and all the folders in which it resides in the hierarchy) I can't deleted it. I tell it to delete backups of that folder (or folders it is in), I put in the password, and goes "ding". But nothing disappears...
    (After I wrote this, I tried unchecking "ignore ownerships" and the problem did not reappear. I can still put files in the trash without the immediate deletion problem.)
    Message was edited by: davidpsummers
    Message was edited by: davidpsummers

    Pondini wrote:
    davidpsummers wrote:
    Also, I had trouble deleting the backups of those files and folders in time machine. I can delete most of it. But for one folder (and all the folders in which it resides in the hierarchy) I can't deleted it. I tell it to delete backups of that folder (or folders it is in), I put in the password, and goes "ding". But nothing disappears...
    Are you doing that via the Finder or Terminal? If so, that's not the way to delete backups. See #12 in [Time Machine - Frequently Asked Questions|http://web.me.com/pondini/Time_Machine/FAQ.html] (or use the link in *User Tips* at the top of the +Time Machine+ forum).
    And now I'm getting an error in time machine. "Files can't be copied onto the backup disk because it appears to be "read only"". I do get info on the disk, and my account has Read & Write privleges, but it say "You can only read" above that".
    The Finder or Terminal deletions may have corrupted your backups. Repair them, per #A5 in [Time Machine - Troubleshooting|http://web.me.com/pondini/Time_Machine/Troubleshooting.html] (or use the link in *User Tips* at the top of the +Time Machine+ forum).
    Message was edited by: Pondini
    I'm doing the deletion through Time Machine (I go into Time Machine, find the folder in the backup, and ask Time machine to delete all backups of that folder).
    I did find the tip of unmounting the disk, rebooting, and remounting it. That Stopped messages about the disk being read only. However, the folder still doesn't delete. I'm also a bit worried about these being symptoms of some other problem...
    Message was edited by: davidpsummers

  • Deleting/dropping/removing database using Enterprise Manager  (12c)

    Hi,
    I have run some searches and review the documentation... but I haven't found any way to drop/remove/delete databases using 12c EM.
    We have multi-instance environments (one physical server with several instances/database). And from time to time we have to remove one or more instances when they are decommissioned.
    So far we are using DBCA, but I wonder if there is any way to do the same with EM "out of the box ...
    Could someone point me in the right direction?
    Thanks in advance,
    Francisco Palomares

    Hello Francisco,
    the only "out of the box" methods to delete/remove a database would be:
    - Create a "User defined procedure" to do the job - Checkout the "Lifecycle Management" guide in the documentation
    - When using the Self Service Portal as part of the Cloud Management feature, users would be able to request for a database to be created. When requesting for a database to be created the user can also identify for what period he/she would need the database. Meaning that you can indicate the moment a database need to be decommissioned. In that case not only a Job will be scheduled to create the requested database, but also a job will be scheduled to remove the database after the indicated time frame has passed. Check for this the Cloud Management Guide.
    - You could of course also think about doing this using a custom made script that you could schedule from the EM job system.
    Well enough material to think about ;-)
    Regards
    Rob
    http://oemgc.wordpress.com

  • Problem in Database

    Dear all
    I am facing a problem in database
    well
    whenever a insert statement is fired the system is hangout
    and
    in server when some inactive sessions are killed the statement gets completed
    and always have to do that
    whenever a insert statement is fired
    how to solve this problem

    I think you have a powerful lock problem in your database. Can you try to look some dictionary views related to locks before and during this special insert??

  • Delete entries from Database table  t71inp1

    Hi,
    I want to Delete entries from Database table  t71inp1. Its a H R Table. I want to know the exact code.
    i saw the cide delete bkpf where usnam = p_name.
    Will it work the same here. Also.
    Please let me know.
    I hope to get reply from you soon.
    where should i write the code. i.e. Tcode SE38 and directly deeleting write the code.
    Please give me some inputs. I am new to H R ABAp
    Shivakumar K B
    919886920258

    hi
    You can write a program in se38.
    create a program.
    use delete from t71inp1 where<condition> command in it.

  • Delete rows in database table

    Hi ,
    I need to delete all the records in the dtabase table and insert new data into it.
    I use the below code , but the delete returns with sy-subrc 4 and doesnt delete the records in table ?
    delete ZZVT2_BW.
      commit work and wait.
      insert ZZVT2_BW from table itab_zvt2 accepting duplicate keys.
      commit work and wait.
    Thanks,

    Deleting from a Database Table
    <b>- DELETE FROM dbtab. or
    DELETE FROM (dbtabname).</b>
    - DELETE dbtab FROM wa. or
    DELETE (dbtabname) FROM wa.
    - DELETE dbtab FROM TABLE itab. or
    DELETE (dbtabname) FROM TABLE itab.
    - DELETE dbtab. or
    DELETE *dbtab.
    - DELETE dbtab VERSION vers. or
    DELETE *dbtab VERSION vers.
    use the bold text in u r program

  • Delete row in database table

    Hi!
    Is there a way to delete row in database table by telling the number of the row?
    Thanx!

    Oh, sorry I didn't properly read your post.
    Try out what rvflannery suggests.
    But, for reference, you should always delete a row by it's unique ID.
    Don't go deleting things, by their position on a table, because a rows position can change.
    V

  • Problem connecting DataBase Link from windows oracle to oracle on Linux

    I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
    I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
    CREATE DATABASE LINK SampleDB
    CONNECT TO myuser IDENTIFIED BY password
    USING 'sample';
    The tns names entry on windows for database in Linux server is as follows
    DSOFT =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = sample)
    But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
    SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
    12154. 00000 - "TNS:could not resolve the connect identifier specified"
    *Cause:    A connection to a database or other service was requested using
    a connect identifier, and the connect identifier specified could not
    be resolved into a connect descriptor using one of the naming methods
    configured. For example, if the type of connect identifier used was a
    net service name then the net service name could not be found in a
    naming method repository, or the repository could not be
    located or reached.
    Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?

    1005745 wrote:
    I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
    I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
    CREATE DATABASE LINK SampleDB
    CONNECT TO myuser IDENTIFIED BY password
    USING 'sample';
    The tns names entry on windows for database in Linux server is as follows
    DSOFT =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = sample)
    But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
    SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
    12154. 00000 - "TNS:could not resolve the connect identifier specified"
    *Cause:    A connection to a database or other service was requested using
    a connect identifier, and the connect identifier specified could not
    be resolved into a connect descriptor using one of the naming methods
    configured. For example, if the type of connect identifier used was a
    net service name then the net service name could not be found in a
    naming method repository, or the repository could not be
    located or reached.
    Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?A database link is acting as a client to the target, remote database in exactly the same fashion and using exactly the same tns infrastructure as any other client trying to connect to that remote database. your ORA-12154 when querying a db link means exactly the same as if you had gotten it trying to connect with sqlplus, from the same server. Check the link SB provided. Keep in mind that the tnsnames file of concern is the one on the source database server.

  • DBCascade Delete Problem

    The mechanism of DBCascade Delete is controlled by Application server or
    Application server use
    Database "DBCascade Delete" mechanism to do this action.
    Because I use WLS6.1 "Create Default DBMSTables" mechanism to create two
    tables which the
    relationship is many-one. But in my MSSQL database , I find two tables
    created by WLS6.1 have no any
    constraint or foregin key setting for corresponding column.
    And then the mechanism of DBCascade Delete do not work.
    So I add the db constraint and cascade delete in MSSQL database by hand ,
    and then all is fine.
    In the BEA EJB20 Sample "cascadeDelete", there is the table.ddl to let us
    test the sample with ORACLE.
    And I find the table construction has the foregin key constraint.
    If I don't set the "DBCascade Delete" option in WLS6.1 console but DB
    Schema has the foregin key constraint
    , so the mechanism "DBCascade Delete" does still work ??
    Anyone can explain how it work in WLS 6.1 ??
    Thank in advance.
    Alan Chang.

    Alan,
    This option is really only a 'convenience' feature for development and prototyping.
    It really is a 'best approximation[ - - for more control, you really need to
    define the schema definition 'by hand' (as you did as a prior step that worked)
    Chuck Nelson
    Developer Relations Engineer
    BEA Support

Maybe you are looking for

  • How can I export a Keynote presentation to a text file?

    I am using Keynote to teach a course at university. One of the students is visually impaired and requires a text version of the presentation for use with his reading software. What's the easiest way to get my presentation into a text format for him?

  • How can I get my Canon A620 to work with Windows 7

    Just signed up here, ot the brightest with tech stuff. I'm trying to get my Powershot A620 to work with Windows 7. I'm guessing there's drivers I need to down load ? Will they be on the Canon website or on this help site ?  I'll keep looking around. 

  • Printing taking too long

    Using java print APIs to print some labels and it's taking way too long. Creating the panels and sending them to the printer doesn't take too long, but once the app is finished and it has been sent the printer reads "processing job" for a long time b

  • I'm trying to download elements 10 from disc but keep getting error message 1935,

    I've tried removing AVG ant virus software but still no joy, any ideas?

  • File to RFC (Error Mail )

    Hi, I have a requirement like legacy system details ( flat file ) send to RFC/Bapi and the status ( Success or Error ) should be updated to the concerned people with the mail. How can we achieve this in XI? I have done with the File to RFC scenario..