Problems updating a database

i'm developing in jsp, an intranet that runs on Weblogic Server
5.1, but it seems something is wrong with the oracle, one user
updates the data in one machine, and does not see the changes
inmediatly, he has to reload the page in order to see it, so
while i get into the same page, i do see the changes, what can be
wrong, i'm using Oracle 8.0.6, i know that the JDBC drivers are
set up with autocommit, so i don't have to send a commit to the
database, i think is a problem with the oracle server
configuration, can someone pls help me?, thanks in advance
regards

You HAVE to commit programatically(like conn.commit()...) before
getting out of that method. and i have a confusion whether
generally by default the i know that the JDBC drivers are
set up with autocommit as false. i think its the other way round.
Thanks.
Arnab

Similar Messages

  • Problem updating mySQL database

    I am trying to update some data in one of my tables called topic in my SQL database. I have the follwing code which gets data from a bean and updates it in the database but it does not seem to work. I do not get an exception but it will not update the record even though the bean displays the correct information about the update it does not seem to update the database, Does anyone have any idea where i am going wrong?
    String updateTopic__topicID = null;
    if (request.getParameter("topicID") != null) {
        updateTopic__topicID = (String)request.getParameter("topicID");
    String insertTopic__username = null;
    if (session.getValue("MM_Username") != null) {
        insertTopic__username = (String)session.getValue("MM_Username");
    Driver DriverupdateTopic   = (Driver)Class.forName(MM_connQuestion_DRIVER).newInstance();
    Connection ConnupdateTopic = DriverManager.getConnection(MM_connQuestion_STRING, MM_connQuestion_USERNAME,
                                                             MM_connQuestion_PASSWORD);
    PreparedStatement updateTopic =
                          ConnupdateTopic.prepareStatement("UPDATE Question.topic  SET Topic_Name = '" + topicData.topicName
                                                               + "', Description = '" + topicData.topicDescription
                                                               + "'  WHERE Topic_ID = '" + updateTopic__topicID + "' ");
    updateTopic.executeUpdate();

    I tried to check it and it did not update any records
    cos i got this.
    Records updated: 0
    The WHERE claus does match my database record because
    it is called Topic_ID which is the primary key for
    that table. could it be something that is wrong with
    my database?
    Sir,
    That is unlikely.
    What is more likely is that something is wrong with your code somewhere.
    I am somewhat suspicious of the STRING nature of Topic_ID. That is an auto_incrementing field I think? If so try setInt or setLong.
    And to answer the followup question to that.
    int anintvalue = Integer.parseInt(astringvalue);The other possibility is that in your form or whatever the value of the Topic_ID is getting mucked up. I would check to make sure you have the value you think.
    Finally always make sure you are talking to the database you think you are. I realize this seems stupid but in testing environments these things do happen more often then one might suppose.
    Sincerely,
    Slappy

  • Problems updating JDBC database

    Please someone help me with my connection to MSAccess database. If it is possible, email me to [email protected]
    1.
    connection.getMetaData().
    supportsResultSetConcurrency( ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE)=true !!!
    2.
    stmt=database.createStatement(
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    OK.
    3.
    stmt.executeUpdate("DELETE FROM "+tblName);
    rset=stmt.executeQuery("SELECT * FROM "+tblName);
    ERROR. Why?

    I have heard that there are JDBC drivers that will throw an error if you try to select from an empty table. But it would help to know what error you are getting. And what driver you are using.

  • Problem viewing/updating MySQL-database with utf-8 charset

    System specs:
    Tomcat 5.5.4
    JDK1.5.0
    MySQL 4.1
    Connector/J 3.0.16
    JSTL 1.1
    I am trying to build a guestbook web-app, and want to be able to store swedish characters (available in latin1) and decided to give utf-8 a go since it would support other languages as well. I use a <Resource> in my context-xml to get the connection.
    This simply will not work; when I use the <%@ page contentType="text/html; charset=utf-8"%> declaration, the swedish characters in the raw html-code gets replaced by questionmarks. Select-queries output look ok though, as long as they don't contain the character '�'
    When removing the page-declaration, the queries show only questionmarks where swedish characters should be.
    The same goes for updating my database. Swedish characters get garbled.
    I have tried the following without success:
    *adding &useUnicode=true&characterEncoding=UTF-8 to the Resource-url -- causes my web-app to fail loading.
    *adding a <filter> to the web-apps web.xml as suggested at  http://www.javaworld.com/javaworld/jw-09-2004/jw-0906-unicode_p.html -- caused another web-app error, resulting in it not being loaded.
    *setting the form attribute accept-charset -- resulted in no improvement.
    Right now I'm half desperate and half fed-up. Is this a common problem with MySQL? Should I use another database? Or perhaps it is the Connector/J Driver that's messing things up.
    I'll appreciate any help I get greatly.

    Hello. Maybe not so interesting after a year to try to ask did you ever get a final solution to that problem in command line perspective. OR does somebody else knows solution to this problem.
    Anyway I have similar problem, I use mysql5 with latin1 charset and I can insert to my database letters ��� normally via mysql command line and they show perfectly. But the problem is my web application.
    I can insert all characters to database and retrieve them normally via web app but if i need to use mysql command line for queries it fails because those special letters appear something like ��. I still need to make queries on mysql command line as admin. I have also tried to change different drivers like
    Class.forName("org.gjt.mm.mysql.Driver"); or
    com.mysql.jdbc.Driver etc connector is 3.0.17
    I have also tried to change to utf-8 and then changed mysql def.enc to same... i have used request.setWHATEVER CHARSET.....i'm out of ideas... help?

  • Problem updating data into ms access database

    Hi! I need to update a database based on user's entries. But I have a problem with the updating code. Can some1 help? Here is my whole servlet's code :
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class editstaff extends HttpServlet
      static Connection link;
      static Statement statement;
      static ResultSet results;
      public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
        response.setContentType("text/HTML");
        PrintWriter out = response.getWriter();
        out.println("<HTML>");
        out.println("<HEAD>");
        out.println("<TITLE>Edit Staff Particulars</TITLE>");
        out.println("</HEAD>");
        out.println("<BR><BR>");
        out.println("<BODY>");
        String staff = request.getParameter("name");
           try
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            link = DriverManager.getConnection("jdbc:odbc:occ","","");
          catch(ClassNotFoundException e)
            System.out.println("Sorry! Unable to load driver. Pls try again later.");
            System.exit(1);
          catch(SQLException e)
            System.out.println("Sorry! Unable to connect to the database. Pls try again later.");
            System.exit(1);
         try
            statement=link.createStatement();
            String select = "SELECT * FROM Staff WHERE Name =  '" + staff+"'";//name taken from html page
             results = statement.executeQuery(select);
            out.println("<table border=1>");
            out.println("<tr>");
            out.println("<th bgcolor=orchid>Name</th>");
            out.println("<th bgcolor=orchid>IC</th>");
            out.println("<th bgcolor=orchid>Staff_ID</th>");
            out.println("<th bgcolor=orchid>Date_Joined</th>");
            out.println("<th bgcolor=orchid>Address</th>");
            out.println("<th bgcolor=orchid>Date_of_Birth</th>");
            out.println("<th bgcolor=orchid>Designation</th>");
            out.println("<th bgcolor=orchid>Driving_License</th>");
            out.println("<th bgcolor=orchid>Mobile</th>");
            out.println("<th bgcolor=orchid>Home_Tel</th>");
            out.println("<th bgcolor=orchid>E-mail</th>");
            out.println("<th bgcolor=orchid>Section</th>");
            out.println("<th bgcolor=orchid>Department</th>");
            out.println("<th bgcolor=orchid>Course</th>");
            out.println("<th bgcolor=orchid>Date_Trained</th>");
            out.println("<th bgcolor=orchid>Recurrent_Date</th>");
            out.println("<th bgcolor=orchid>Proficiency</th>");
            while (results.next())
              out.println("<tr>");
              out.println("<td>");
              out.println(results.getString(1));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(8));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(9));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(16));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(4));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(6));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(10));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(7));
              out.println("</td>");
              out.println("<td>");
              out.println(new Integer(results.getString(2)));
              out.println("</td>");
              out.println("<td>");
              out.println(new Integer(results.getString(3)));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(5));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(17));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(11));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(12));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(13));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(14));
              out.println("</td>");
              out.println("<td>");
              out.println(results.getString(15));
              out.println("</td>");
              out.println("</tr>");
            out.println("</table>");
            out.println("<BR><BR><BR>");
            out.println("<table border=1>");
            out.println("<tr>");
            out.println("<th>Name</th>");
            out.println("<td><input name=nam type=text id=nam></td>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<th>IC number</th>");
            out.println("<td><input name=ic type=text id=ic></td>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<th>Staff ID</th>");
            out.println("<td><input name=ID type=text id=ID></td>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<th>Date Joined</th>");
            out.println("<td>");
            out.println("<select name=jday size=1 id=jday>");
            out.println("<option>1</option>");
            out.println("<option>2</option>");
            out.println("<option>3</option>");
            out.println("<option>4</option>");
            out.println("<option>5</option>");
            out.println("<option>6</option>");
            out.println("<option>7</option>");
            out.println("<option>8</option>");
            out.println("<option>9</option>");
            out.println("<option>10</option>");
            out.println("<option>11</option>");
            out.println("<option>12</option>");
            out.println("<option>13</option>");
            out.println("<option>14</option>");
            out.println("<option>15</option>");
            out.println("<option>16</option>");
            out.println("<option>17</option>");
            out.println("<option>18</option>");
            out.println("<option>19</option>");
            out.println("<option>20</option>");
            out.println("<option>21</option>");
            out.println("<option>22</option>");
            out.println("<option>23</option>");
            out.println("<option>24</option>");
            out.println("<option>25</option>");
            out.println("<option>26</option>");
            out.println("<option>27</option>");
            out.println("<option>28</option>");
            out.println("<option>29</option>");
            out.println("<option>30</option>");
            out.println("<option>31</option>");
            out.println("</select>");
            out.println("<select name=jmth size=1 id-jmth>");
            out.println("<option>January</option>");
            out.println("<option>February</option>");
            out.println("<option>March</option>");
            out.println("<option>April</option>");
            out.println("<option>May</option>");
            out.println("<option>June</option>");
            out.println("<option>July</option>");
            out.println("<option>August</option>");
            out.println("<option>September</option>");
            out.println("<option>October</option>");
            out.println("<option>November</option>");
            out.println("<option>December</option>");
            out.println("</select>");
            out.println("<select name=jyear size=1 id=jyear");
            out.println("<option>2004</option>");
            out.println("<option>2005</option>");
            out.println("<option>2006</option>");
            out.println("<option>2007</option>");
            out.println("<option>2008</option>");
            out.println("<option>2009</option>");
            out.println("<option>2010</option>");
            out.println("<option>2011</option>");
            out.println("<option>2012</option>");
            out.println("<option>2013</option>");
            out.println("<option>2014</option>");
            out.println("</select></td></tr>");
            out.println("<tr><th>Address</th>");
            out.println("<td><textarea name=add id=add></textarea></td></tr>");
            out.println("<tr><th>Date of Birth");
            out.println("<td>");
            out.println("<select name=bday size=1 id=bday>");
            out.println("<option>1</option>");
            out.println("<option>2</option>");
            out.println("<option>3</option>");
            out.println("<option>4</option>");
            out.println("<option>5</option>");
            out.println("<option>6</option>");
            out.println("<option>7</option>");
            out.println("<option>8</option>");
            out.println("<option>9</option>");
            out.println("<option>10</option>");
            out.println("<option>11</option>");
            out.println("<option>12</option>");
            out.println("<option>13</option>");
            out.println("<option>14</option>");
            out.println("<option>15</option>");
            out.println("<option>16</option>");
            out.println("<option>17</option>");
            out.println("<option>18</option>");
            out.println("<option>19</option>");
            out.println("<option>20</option>");
            out.println("<option>21</option>");
            out.println("<option>22</option>");
            out.println("<option>23</option>");
            out.println("<option>24</option>");
            out.println("<option>25</option>");
            out.println("<option>26</option>");
            out.println("<option>27</option>");
            out.println("<option>28</option>");
            out.println("<option>29</option>");
            out.println("<option>30</option>");
            out.println("<option>31</option>");
            out.println("</select>");
            out.println("<select name=bmth size=1 id=bmth>");
            out.println("<option>January</option>");
            out.println("<option>February</option>");
            out.println("<option>March</option>");
            out.println("<option>April</option>");
            out.println("<option>May</option>");
            out.println("<option>June</option>");
            out.println("<option>July</option>");
            out.println("<option>August</option>");
            out.println("<option>September</option>");
            out.println("<option>October</option>");
            out.println("<option>November</option>");
            out.println("<option>December</option>");
            out.println("</select>");
            out.println("<select name=byear size=1 id=byear>");
            out.println("<option>1946</option>");
            out.println("<option>1947</option>");
            out.println("<option>1948</option>");
            out.println("<option>1949</option>");
            out.println("<option>1950</option>");
            out.println("<option>1951</option>");
            out.println("<option>1952</option>");
            out.println("<option>1953</option>");
            out.println("<option>1954</option>");
            out.println("<option>1955</option>");
            out.println("<option>1956</option>");
            out.println("<option>1957</option>");
            out.println("<option>1958</option>");
            out.println("<option>1959</option>");
            out.println("<option>1960</option>");
            out.println("<option>1961</option>");
            out.println("<option>1962</option>");
            out.println("<option>1963</option>");
            out.println("<option>1964</option>");
            out.println("<option>1965</option>");
            out.println("<option>1966</option>");
            out.println("<option>1967</option>");
            out.println("<option>1968</option>");
            out.println("<option>1969</option>");
            out.println("<option>1970</option>");
            out.println("<option>1980</option>");
            out.println("<option>1981</option>");
            out.println("<option>1982</option>");
            out.println("<option>1983</option>");
            out.println("<option>1984</option>");
            out.println("<option>1985</option>");
            out.println("<option>1986</option>");
            out.println("<option>1989</option>");
            out.println("<option>1990</option>");
            out.println("</select></td></tr>");
            out.println("<tr><th>Designation</th>");
            out.println("<td><input name=designation type=text id=designation></td></tr>");
            out.println("<tr><th>Driving License</th>");
            out.println("<td>");
            out.println("<select name=license size=1 multiple=multiple id=license>");
            out.println("<option>Class 3</option>");
            out.println("<option>Class 4</option>");
            out.println("<option>Class 5</option>");
            out.println("</select></td></tr>");
            out.println("<tr><th>Mobile</th>");
            out.println("<td><input name=mobile type=text id=mobile></td></tr>");
            out.println("<tr><th>Home Tel</th>");
            out.println("<td><input name=home type=text id=home></td></tr>");
            out.println("<tr><th>E-mail Address</th>");
            out.println("<td><input name=email type=text id=email</td></tr>");
            out.println("</tr><th>Section</th>");
            out.println("<td>");
            out.println("<select name=section size=1 id=section>");
            out.println("<option>Ramp</option>");
            out.println("<option>Baggage</option>");
            out.println("<option>Service Asisstants</option>");
            out.println("<option>Flight Coordinators</option>");
            out.println("</select></td>");
            out.println("<th>Department</th>");
            out.println("<td>");
            out.println("<select name=dept size=1 id=dept>");
            out.println("<option>PAX</option>");
            out.println("<option>Ramp</option>");
            out.println("<option>Cargo</option>");
            out.println("</select></td>");
            out.println("<th>Course</th>");
            out.println("<td>");
            out.println("<select name=course size=1 multiple=multiple id=course>");
            out.println("<option>Ramp Safety</option>");
            out.println("<option>Dangerous Goods</option>");
            out.println("<option>Security Training</option>");
            out.println("</select></td></tr>");
            out.println("<tr><th>Date Trained</th>");
            out.println("<td>");
            out.println("<select name=tday size=1 id=tday>");
            out.println("<option>1</option>");
            out.println("<option>2</option>");
            out.println("<option>3</option>");
            out.println("<option>4</option>");
            out.println("<option>5</option>");
            out.println("<option>6</option>");
            out.println("<option>7</option>");
            out.println("<option>8</option>");
            out.println("<option>9</option>");
            out.println("<option>10</option>");
            out.println("<option>11</option>");
            out.println("<option>12</option>");
            out.println("<option>13</option>");
            out.println("<option>14</option>");
            out.println("<option>15</option>");
            out.println("<option>16</option>");
            out.println("<option>17</option>");
            out.println("<option>18</option>");
            out.println("<option>19</option>");
            out.println("<option>20</option>");
            out.println("<option>21</option>");
            out.println("<option>22</option>");
            out.println("<option>23</option>");
            out.println("<option>24</option>");
            out.println("<option>25</option>");
            out.println("<option>26</option>");
            out.println("<option>27</option>");
            out.println("<option>28</option>");
            out.println("<option>29</option>");
            out.println("<option>30</option>");
            out.println("<option>31</option>");
            out.println("</select>");
            out.println("<select name=tmth size=1 id=tmth>");
            out.println("<option>January</option>");
            out.println("<option>February</option>");
            out.println("<option>March</option>");
            out.println("<option>April</option>");
            out.println("<option>May</option>");
            out.println("<option>June</option>");
            out.println("<option>July</option>");
            out.println("<option>August</option>");
            out.println("<option>September</option>");
            out.println("<option>October</option>");
            out.println("<option>November</option>");
            out.println("<option>December</option>");
            out.println("</select>");
            out.println("<select name=tyear size=1 id=tyear>");
            out.println("<option>2005</option>");
            out.println("<option>2006</option>");
            out.println("<option>2007</option>");
            out.println("<option>2008</option>");
            out.println("<option>2009</option>");
            out.println("<option>2010</option>");
            out.println("<option>2011</option>");
            out.println("<option>2012</option>");
            out.println("<option>2013</option>");
            out.println("<option>2014</option>");
            out.println("<option>2015</option>");
            out.println("</select></td></tr>");
            out.println("<tr><th>Recurrent Date</th>");
            out.println("<td>");
            out.println("<select name=rday size=1 id=rday>");
            out.println("<option>1</option>");
            out.println("<option>2</option>");
            out.println("<option>3</option>");
            out.println("<option>4</option>");
            out.println("<option>5</option>");
            out.println("<option>6</option>");
            out.println("<option>7</option>");
            out.println("<option>8</option>");
            out.println("<option>9</option>");
            out.println("<option>10</option>");
            out.println("<option>11</option>");
            out.println("<option>12</option>");
            out.println("<option>13</option>");
            out.println("<option>14</option>");
            out.println("<option>15</option>");
            out.println("<option>16</option>");
            out.println("<option>17</option>");
            out.println("<option>18</option>");
            out.println("<option>19</option>");
            out.println("<option>20</option>");
            out.println("<option>21</option>");
            out.println("<option>22</option>");
            out.println("<option>23</option>");
            out.println("<option>24</option>");
            out.println("<option>25</option>");
            out.println("<option>26</option>");
            out.println("<option>27</option>");
            out.println("<option>28</option>");
            out.println("<option>29</option>");
            out.println("<option>30</option>");
            out.println("<option>31</option>");
            out.println("</select>");
            out.println("<select name=rmth size=1 id=rmth>");
            out.println("<option>January</option>");
            out.println("<option>February</option>");
            out.println("<option>March</option>");
            out.println("<option>April</option>");
            out.println("<option>May</option>");
            out.println("<option>June</option>");
            out.println("<option>July</option>");
            out.println("<option>August</option>");
            out.println("<option>September</option>");
            out.println("<option>October</option>");
            out.println("<option>November</option>");
            out.println("<option>December</option>");
            out.println("</select>");
            out.println("<select name=ryear size=1 id=ryear>");
            out.println("<option>2005</option>");
            out.println("<option>2006</option>");
            out.println("<option>2007</option>");
            out.println("<option>2008</option>");
            out.println("<option>2009</option>");
            out.println("<option>2010</option>");
            out.println("<option>2011</option>");
            out.println("<option>2012</option>");
            out.println("<option>2013</option>");
            out.println("<option>2014</option>");
            out.println("<option>2015</option>");
            out.println("</select></td></tr>");   
            out.println("<tr><th>Proficiency</th>");
            out.println("<td><input name=prof type=text id=prof</td></tr>");
            out.println("</table>");
            out.println("<p align=right>");
      out.println("<input type=submit name=submit value=Submit>");
      out.println("<input type=reset name=reset value=Reset>");
      out.println("</p>");
            String nam = request.getParameter("nam");
            String ic = request.getParameter("IC");
            String jday = request.getParameter("jday");
            String jmth = request.getParameter("jmth");
            String jyear = request.getParameter("jyear");
            String mobile = request.getParameter("mobile");
            String home = request.getParameter("home");
            String add = request.getParameter("add");
            String email = request.getParameter("email");
            String day = request.getParameter("day");
            String mth = request.getParameter("mth");
            String year = request.getParameter("year");
            String designation = request.getParameter("designation");
            String dept = request.getParameter("dept");
            String ID = request.getParameter("ID");
            String license = request.getParameter("license");
            String course = request.getParameter("course");
            String tday = request.getParameter("tday");
            String tmth = request.getParameter("tmth");
            String tyear = request.getParameter("tyear");
            String rday = request.getParameter("rday");
            String rmth = request.getParameter("rmth");
            String ryear = request.getParameter("ryear");
            String prof = request.getParameter("prof");
            String sect = request.getParameter("job");
        String dob = ""+day+"-"+mth+"-"+year+"";
        String train = ""+tday+"-"+tmth+"-"+tyear+"";
        String date = ""+jday+"-"+jmth+"-"+jyear+"";
        String recurrent = ""+rday+"-"+rmth+"-"+ryear+"";
            String name = request.getParameter("name");
            String change = "UPDATE Staff  SET Name='"+nam+"',Mobile='"+mobile+"',Home='"+home+"',"
                                    +"Address='"+add+"',E-mail='"+email+"',DOB='"+dob+"',Driving License='"+license+"',IC='"+ic+"',"
                                    +"Staff ID='"+ID+"',Designation='"+designation+"',Department='"+dept+"',Course='"+course+"',"
                                    +"Date Trained='"+train+"',Recurrent Date='"+recurrent+"',Proficiency='"+prof+"',"
                                    +"Date Joined='"+date+"',Section'"+sect+"' WHERE Name='"+name+"'";//name taken from html page
            results = statement.executeQuery(change);
          catch(SQLException e)
            System.out.println("Sorry! Unable to update data. Pls try again later.");
            e.printStackTrace();
            System.exit(1);
          try
              out.println("<br />");
              out.println("</font></BODY>");
              out.println("</HTML>");
              out.flush();
              link.close();
          catch(SQLException e)
            System.out.println("Sorry! Unable to execute query. Pls try again later.");
            e.printStackTrace();
            System.exit(1);
      

    hi,
    For Select Query there is Method executeQuery();
    For insert, update, delete executeUpdate() is use
    so try with executeUpdate()
    and it will return how much row are updated.

  • Problem in update to database

    Dear sir,
    I am making project on library management system using Netbeans 6.1
    in which i am able to connect my databases to the jtable in the frame sucessfully(jtable is used to display records of students who jahave issued the books) but when
    I peform update to database
    using following statements it gives me error that "no suitable driver found for java:derby:lib" in which lib is my database name.
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                                String url = "jdbc:derby:lib";         try {               try {               Class.forName("org.apache.derby.jdbc.ClientDriver");             } catch (ClassNotFoundException ex) {                 Logger.getLogger(delUI.class.getName()).log(Level.SEVERE, null, ex);             }             Connection con = DriverManager.getConnection(url,"lib","lib");             java.sql.Statement stmt =  con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,                                     ResultSet.CONCUR_UPDATABLE);           ResultSet srs = stmt.executeQuery("delete * from student where sholarno="+jTextField2.getText());         } catch (SQLException ex) {             Logger.getLogger(delUI.class.getName()).log(Level.SEVERE, null, ex);         }       }                                               
    Also i observe that when I build the program the build is succesfull &
    there is one following statement written which says that it is not copying the libraries:
    D:\Program Files\glassfish-v2ur2\javadb\lib\derbyclient.jar is a directory or can't be read. Not copying the libraries.
    Building jar: C:\Documents and Settings\super\My Documents\NetBeansProjects\LibMan\dist\LibMan.jar
    Not copying the libraries.
    Sir, please help me to solve the above problem . Please tell me that it is not copying the files whether this causes the problem or anything is missing.

    The url listed is for an embedded Driver, but your loading the ClientDriver. So, which is it?

  • Problems updating database

    Hello everyone,
    maybe someone has a good example on how to update *.mdb database through JTextFields multiple times, i have tried lots of things, but always there shows up java.lang errors and so on! :((( Maybe problem is in that when im selecting from database i cast .toString() to see the numerical values and so on, and if i want to return it still runs them as a string not numerical! :(
    And other thing- how correctly update object through tablemodels setValueAt where i call rs.updateObject, maybe this could be the salvation of my problems, when i just give values from my JTextFields to JTable interface, and from JTable directly to TableModel???
    I have been looking for good example for tableModel extending deaultTableModel an its methods, and have found none, i was searching somewhere for 4 days and got sicko of this all, really theres no chance to find something like that? Problem sits in that i dont know how correctly populate JTable with data if Im extending DefaultTableModel, couse all the time problems are with return allrows.size()
    Tnx!!1

    now i write something of int type in this jTextField and wish to make an update onceSo create a GUI with a text field and a button. When you click the button you get the value from the text field and invoke SQL that updates the database.
    You can find [url  http://java.sun.com/docs/books/tutorial/]tutorials here on building a GUI and on using JDBC. So read the tutorials and give it a go. I'll give you a hint. For the database update I would use a PreparedStatement:
    String sql = "INSERT INTO Page (Name, Title) VALUES (?, ?)";
    PreparedStatement stmt = connection.prepareStatement(sql);
    stmt.setString( 1, "Name1" );
    stmt.setString( 2, "Title1" );
    stmt.executeUpdate();If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Problems updating the BAM database

    Hi Guys,
    I have an activity that runs for a long time and after executing for about 15-16 mins it causes the following exception.
    Did somebody else also faced this problem ever? I have tried configuring all possible timeout parameters but all in vain.
    Any help would be highly appreciated.
    Thanks,
    MK
    EXCEPTION DETAILS
    Problems updating the BAM database. Reason:Unable to connect to the database.
    Caused by: A lock could not be obtained within the time requested
    fuego.analyzer.UpdaterRuntimeException: Unable to connect to the database.
         at fuego.analyzer.UpdaterRuntimeException.cannotConnecToDatabase(UpdaterRuntimeException.java:80)
         at fuego.analyzer.UpdaterRunner.synchronizeMetadata(UpdaterRunner.java:494)
         at fuego.analyzer.UpdaterRunner.run(UpdaterRunner.java:273)
         at fuego.analyzer.UpdaterRunner.runUpdater(UpdaterRunner.java:176)
         at fuego.server.service.BAMRunnerService.runUpdater(BAMRunnerService.java:62)
         at fuego.server.execution.BAMUpdater.execute(BAMUpdater.java:33)
         at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:290)
         at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:465)
         at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:543)
         at fuego.transaction.TransactionAction.start(TransactionAction.java:216)
         at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:116)
         at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:56)
         at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
         at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:265)
         at fuego.server.execution.ToDoItem.run(ToDoItem.java:536)
         at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:752)
         at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:732)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:138)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:130)
         at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:429)
         at fuego.component.ExecutionThread.work(ExecutionThread.java:816)
         at fuego.component.ExecutionThread.run(ExecutionThread.java:395)
    Caused by: SQL Exception: A lock could not be obtained within the time requested
         at com.ibm.db2cs.m.j.generateCsSQLException(Unknown Source)
         at com.ibm.db2cs.m.b.wrapInSQLException(Unknown Source)
         at com.ibm.db2cs.m.b.handleException(Unknown Source)
         at com.ibm.db2cs.m.d.handleException(Unknown Source)
         at com.ibm.db2cs.m.t.handleException(Unknown Source)
         at com.ibm.db2cs.m.s.closeOnTransactionError(Unknown Source)
         at com.ibm.db2cs.m.s.movePosition(Unknown Source)
         at com.ibm.db2cs.m.s.next(Unknown Source)
         at fuego.jdbc.FaultTolerantResultSet.next(FaultTolerantResultSet.java:553)
         at fuego.analyzer.Updater.loadInstanceInfoValues(Updater.java:1039)
         at fuego.analyzer.Updater.loadInstanceInfoValues(Updater.java:988)
         at fuego.analyzer.Updater.loadInstanceInfo(Updater.java:982)
         at fuego.analyzer.Updater.synchronize(Updater.java:252)
         at fuego.analyzer.UpdaterRunner.synchronizeMetadata(UpdaterRunner.java:480)
         ... 20 more

    Good morning justinmm357,
    I would be more than happy to help delink the secondary email address from your My Best Buy™ account.  Please send me a private message with the information below, by clicking on the blue button in my signature, and I will make sure that everything is up-to-date.
    Name
    Phone #
    Mailing address
    Email address (primary and secondary)
    Thank you for reaching out to us on the forum and for being a My Best Buy™ member!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Problem while updating a database table

    Hi experts,
                         I've used the FM 'HR_INFOTYPE_OPERATION' to update the database table. In that i used the MOD operation to update the Infotype PA0315.  But it return an error message like "Infotype does not exist". What could be the reason for this error?.
    regards,
    Shanthi.

    Hi,
          Here is my code for updation.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = P0315-pernr
    IMPORTING
    RETURN = wf_returne.
    Update Mode
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0315'
    NUMBER = P0315-PERNR
    SUBTYPE = P0315-SUBTY
    OBJECTID = P0315-OBJPS
    LOCKINDICATOR = P0315-SPRPS
    VALIDITYEND = P0315-ENDDA
    VALIDITYBEGIN = P0315-BEGDA
    RECORDNUMBER = P0315-SEQNR
    RECORD = P0315
    OPERATION = 'MOD'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = wf_return.
    Dequeue
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = P0315-PERNR.

  • Help with updating a database while in cfloop

    Greetings. I'm having some difficulties in updating a
    database using cfquery inside of a cfloop.
    Background:
    I've got a text file that I need to interpret, line for line,
    and then update an existing database with information from that
    text file. For example, the text file might say
    jdoe~103 Anywhere St.~East Nowhere~New Jersey~05784~
    asmith~8963 North St.~Crabapple Cove~Maine~01390~
    (etc...you get the idea)
    So, I use a CFFILE to read the file, and then calculate the
    number of lines (records to be updated in the database) using
    listlen / 5 (in this example). From there, I:
    <cfloop index="record" from="1" to "#numberoflines#">
    <cfloop index="field" from="1" to "5">
    <cfset position = ((record - 1) * 5) + field>
    <cfelseif field EQ 1>
    <cfset form.username =
    ListGetAt(newcontents,position,"~")>
    <cfelseif field EQ 2>
    <cfset form.street =
    ListGetAt(newcontents,position,"~")>
    (etc...through EQ 5)
    </cfloop>
    <cfquery name="updatedatabase"
    datasource="clientlist">
    UPDATE clients
    SET
    Street= '#form.street#',
    (etc)
    WHERE email = '#form.username#'
    </cfquery>
    </cfloop>
    The problem I am having is that it updates the very first
    record in the set of records to update, but then it does not update
    any subsequent records.
    Why?
    Sorry if the code is crude. Is there a better way of doing
    this? If so, great detail would be helpful :) Relatively new at
    this.
    -Brian

    quote:
    Originally posted by:
    Dan Bracuk
    Updating a db from a file using cold fusion is generally
    inefficient and should only be used as a last resort. If your db
    has any bulk loading/updating utilities, consider using them. Maybe
    you can use cold fusion to upload the file and ftp it to your db
    server or something like that.
    Better yet, that file has to come from somewhere. Is there a
    way you can update your db instead of generating a file in the
    first place?
    The file starts as an output generated by a web user (an
    administrator on the software) which creates a text file containing
    email addresses, one per line. An external process which I have no
    control over takes that file and generates another file containing
    information about each of those e-mail addresses (last name, first
    name, etc) one per line. I can't change that process. So, I'm left
    with an external text file that I need to parse and then put into
    the database...all through a web interface. The goal here is that
    an administrator of the software, who does not have direct access
    to the database, can (using cold fusion processing) update the
    database with new information on each e-mail address without my
    intervention.
    -Brian

  • Problem with ORACLE database

    Hi all,
    I am facing some problem with ORACLE database while configuring one JDBC scenario in the receiver side. I have configured one JDBC scenario like FILE TO JDBC. As JDBC is at receiver side i have provided the input file with the following format ,
    <root>
      <StatementName1>
         <dbTableName action="INSERT">
             <table>employee</table>
              <access>
                    <flag>NO</flag> 
                    <ID>567</ID>
             <NAME>134</NAME>
                 </access>
         </dbTableName>
      </StatementName1>
    </root>
    But in the ORACLE database all my columns are in the uppercase.
    So when i have tried to send this input file to process through JDBC receiver side then i have faced the below error :
    FATAL ERROR: Column 'flag' does not exist in table 'employee'
    Then I have tried to check with sender side processing of JDBC adapter. By using the SQL statements as
    SELECT * FROM EMPLOYEE WHERE flag='NO'
    UPDATE EMPLOYEE SET Flag='YES'  WHERE flag='NO'
    Here it worked fine.
    Now my question is,
    If the same adapter is working when we are writing a query directly(sender side), then we must also allow case independence in the auto generated SQL part(receiver side).
    The JDBC drivers for both SQL server and Oracle, supports the same java code, for accessing the DB, irrespective of the case of the column names.
    Please clarify this doubt as soon as possible.
    Thanks,
    Soorya.

    Hi Dharmaveer,
    When I go with the following input file,
    <root>
      <StatementName1>
         <dbTableName action="INSERT">
             <table>EMPLOYEE</table>
              <access>
                    <FLAG>NO</FLAG> 
                    <ID>666</ID>
                    <NAME>SSS</NAME>
                 </access>
             </dbTableName>
      </StatementName1>
    </root>
    I will get the following query with succesfull processing.
    INSERT INTO  EMPLOYEE (FLAG, ID, NAME) VALUES (NO, 666, SSS)
    when i go with this input file,
    <root>
      <StatementName1>
         <dbTableName action="INSERT">
             <table>EMPLOYEE</table>
              <access>
                                    <flag>NO</flag> 
                                   <ID>777</ID>
                        <NAME>TTTT</NAME>
                        </access>
                   </dbTableName>
      </StatementName1>
    </root>
    Then i am facing this problem,
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'EMPLOYEE' (structure 'StatementName1'): java.sql.SQLException: FATAL ERROR: Column 'flag' does not exist in table 'EMPLOYEE'
    Here I cant get any SQL statement as it is not successfull.
    I have gone through your link but it also says to modify the column in the input file which is not possible for me. Can you please help me in this regard?
    Thanks,
    Soorya

  • How to update a database from an MS Excel

    Hi,
    I'm developing an application that would let the user view and edit the data from the database through Excel. My problem is, I need to update the database after the data was modified from MS Excel that doesn't need manual intervention.
    Thanks,
    mangyan

    At the risk of encouraging newbies to ask Microsoft specific questions on this Sun site...... the arch-enemy of Microsoft.....
    You can write a VB Macro to execute when the user clicks a button / control on the spreadsheet to say "Commit to database".
    Or maybe ask the user just before they close the database.
    VB has various database methods, like OpenDatabase.
    See examples in the Macro editor.
    Or if you want to give yourself an ounce of self respect, you could write a JSP application to input the values, and update a database via JDBC.
    regards,
    Owen

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • An error occurred while attempting to update the database

    Hi
    the update from 2.82 to 2.9.0 fails for me with following message
    An error occurred while attempting to update the database.
    the update log ends like this
    [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE failed because the
    following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify
    that SET options are correct for use with indexed views and/or indexes on
    computed columns and/or filtered indexes and/or query notifications and/or XML
    data type methods and/or spatial index operations.
    1> 2> 3> [16:56:20] RunShellCommand: Command: osql exited with code: 1
    [16:56:20] RunShellCommand: Exit code indicates failure.
    [16:56:20] UpdateDatabase: Failed to run database update script.
    hope that anyone can solv this for me

    It seems that my problem is with one of ldapservers.
    When the periodic update runs.
    then there will be error periodic update failed
    log file mdm_error looks like this
    [00:01:46] Failed running query:
    IF NOT EXISTS(SELECT LDAPContainerName FROM LDAPContainers WHERE LDAPContainerName=? AND LDAPServerSAKey = ?)
    BEGIN INSERT INTO LDAPContainers(LDAPContainerName, DisplayName, LDAPContainerType, ParentContainerSAKey,
    LDAPServerSAKey, LDAPMemberType, AllowHandsOffEnrollment) VALUES (?,?, 2,
    (SELECT LDAPContainerSAKey FROM LDAPContainers WHERE LDAPContainerName =? AND LDAPServerSAKey =?) , ?, 1, 1) END
    SQLError:
    I think this is the reason that the upgrade fails.
    How can i solve this?

  • Anybody have problems updating from Leopard 10.5.8 to Snow Leopard 10.6.3, or can I expect an easy update?

    Anybody have problems updating from Leopard 10.5.8 to Snow Leopard 10.6.3, or can I expect an easy update?

    rrk224 wrote:
    Anybody have problems updating from Leopard 10.5.8 to Snow Leopard 10.6.3, or can I expect an easy update?
    You shouldn't have too much trouble provided you have a relatively clean system.
    You should backup your personal users folders off the machine to a regular storage drive (not TimeMachine) and disconnect.
    10.6 upgrade strips out the 10.5 PPC code your not using and offers faster video drivers and some neat features like Exposé and Spaces which is highly productive as you can have 4-16 desktops visible at once and move stuff around between them (10.7 ripped that out)
    10.6 is the fastest OS X version Apple has made, 10.5 is universal (more code and older video drivers) and 10.7 is slower than 10.6 in tests on the same hardware.
    Your 10.5 install disk should be working, (check it first) stick it in and reboot holding the c key down, you should be able to boot from the disk. Apple isn't offering replacement 10.5 disks anymore so it needs to work in case you want to downgrade from 10.6.
    You can learn how to make copies of your 10.5 disk online. I would do so.
    You might decide to Carbon Copy Cloner (free/donations) your present 10.5 system to a blank external powered drive, you then can hold the option key and boot from it, erase and reverse clone back to your internal drive if you wish.
    10.6 will run all your 10.5 software (some may need a update) as it has Rosetta, a compatibility system for 10.5 code. 10.7 does not, it will not run your present Rosetta/10.5 software at all, you will have to buy all new versions. Also older hardware likely won't work neither, like printers, scanners and all-in-ones etc as their drivers either won't get a update or they won't make one to force a premature hardware turnover.
    If your upgrading your older 10.5 machine to 10.7, I'd advise against it, there isn't as much software ready for 10.7 (like 10.6) because it's forcing developers to rewrite their PPC based code
    10.7 is slower and more glitchs than 10.6, more depressing gray all over and strange UI changes.
    Also 10.8 is due out this summer and may not run on older hardware, so it's looking like you will be best off with 10.6.8 and leaving it at that to get the most software choice/performance and leave 10.8 for a new hardware/software purchase.
    If your going to 10.7 anyway, then check this database to make sure the software your going to have to buy is ready or not. IMO, Lion for you and your older machine is a wasted effort and better the new software on a new hardware purchase.
    http://roaringapps.com/apps:table
    I must admit though I throughly hate OS X Lion, as do a lot of other people,  it's only because it's quality is absolutely terrible and unbecoming of Apple, likely why Mountain Lion 10.8 is being released this summer a year in advance and only a year after Lion. However my opinion about Lion's poor quality isn't relfected in my advice to you. For you it's more of a older hardware/have to buy all new software type deal which a newer machine with 10.8 and promises to be better/more refined OS than 10.7.
    So in other words, upgrade to 10.6.8 and stay there, save your pennies for a new machine Early 2013, by then 10.8 would have several months and a lot of software/bugs worked out for it.

Maybe you are looking for

  • I bought a movie from itunes on my mac air and now I can't find it.

    I bought the movie Beautiful Creatures from iTunes on my Mac Air. I was in the middle of downloading it, when iTunes crashed and I had to reopen it. When I did, the movie was gone and so was the currently downloading option. I spent $20 on this movie

  • "OutlookSyncClient has stopped working" when Exchange Cached Mode is On.

    Hi, I have an iPhone 3G which originally didn't sync with outlook 2003 in Vista. Sync is being perform via USB. I initially tried reinstalling iTunes, Reset sync history, Syncing with new windows user but could not get it to sync without an error. Vi

  • Nokia n95 movie transfer???

    Hi! I'd be very happy if someone tell me how can i put som movies in my n95? Seems that it's not avaible so easy. If it try to transfer files from my computer to n95...Phone cant't read that kind of files?What should i do? SORRY my bad English, Finni

  • InfiniteSMS app or similar available on Mac App store?

    I'm getting rid of my iPad possibly and switching to a MacBook Air. I like the convience of the InfiniteSMS app and would not want to lose that. Is something similar or same app available through the Mac App Store? I'm at work and cannot pull up the

  • Discoverer 4I (4.1.48.06.00)

    Hi , I want to install Discoverer 4i (Ver :4.1.48.06.00) .Any one can let me know where can i down load the Software . I tried in OTN but i could find any links for teh software to downlaod. Thanks Kiran.