Inserting date into database column automatically

This may be a silly question. But how to add a date(system date) in to the database column automatically when a user submit a form.???
thanks
san

Hi,
Use default values?
SQL>create table t
2  (
3  a number,
4  constraint def_val_b b date default sysdate
5  );
Table created.
SQL>insert into t (a) values (1);
1 row created.
SQL>select * from t;
         A B
         1 22/11/05
1 row selected.Regards,
Yoann.

Similar Messages

  • Error inserting data into database

    Hello I am having error inserting data into database through a servlet.Please I am very new to Java Technology and need your immediate help. beloww is the codea nd the error
    Apache Tomcat/4.0.3
    ERROR: Problems with adding new entry
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2525)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:337)
         at Register.insertIntoDB(Register.java:71)
         at Register.doPost(Register.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
         at java.lang.Thread.run(Thread.java:536)
    COde:
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class Register extends HttpServlet
         public static Statement statement;
         private Connection DBConn;
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   DBConn=DriverManager.getConnection("jdbc:odbc:Challenge");
              catch(Exception e) {
                   e.printStackTrace();
                   DBConn=null;
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
                   String user_id,FirstName,LastName, Email, Login, Password;
              FirstName = req.getParameter("FirstName");
              LastName = req.getParameter("LastName");
              Email = req.getParameter("Email");
              Login = req.getParameter("Login");
              Password = req.getParameter("Password");
              PrintWriter output = res.getWriter();
              res.setContentType("text/html");
              if (user_id.equals("")||
              FirstName.equals("") ||
                   LastName.equals("") ||
                   Email.equals("") ||
                   Login.equals("") ||
                   Password.equals(""))
                        output.println("<H3>Please click back " + "button and fill in all " + "fileds.</H3>");
                        output.close();
                        return;
                   boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
                   if (success)
                        output.print("<H2>Thank You " + FirstName + " for registering.</H2>");
                        res.sendRedirect("file:///Register.html");
                   else
                        output.print("<H2>An error occured. " + "Please try again later.</H2>");
                        output.close();
              private boolean insertIntoDB(String stringtoinsert)
                   try
                        statement = DBConn.createStatement();
                        statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
                        statement.close();
                   catch (Exception e)
                        System.err.println("ERROR: Problems with adding new entry");
                        e.printStackTrace();
                        return false;
                   return true;
              public void destroy()
                   try
                        DBConn.close();
                   catch(Exception e)
                        System.err.println("Problem closing the database");
    Your Help will be very much appreciate.I am using SQL Server database

    The error concerns these two lines:
    boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
    statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
    In the first line above, you have a string which represents the VALUES which you are inserting. There are 5 values. However in the second line above this is your actual SQL execution you are specifying 6 columns of data. If the column "user_id" is an identity or auto-incrementing field in the database, just remove it from this line. If not then you need to supply the "UserID" into the VALUES.
    This should fix the problem.

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • Inserting data into a column from 2 different tables

    Hi,
    I need to insert data into a table using 2 other tables. The tables that contain data have identical column names.
    Is using a UNION statement the only option?
    Also, if I need to insert data into columns from only one of the either tables, how do i do it?
    Thanks.

    For future reference, "doesn't seem to work" is a rather generic description... Posting the particular error message will be quite helpful, though I'm reasonably confident that I know the particular problem here.
    First, if only for sanity, you probably want to explicitly list the columns of the destination table in your INSERT statement.
    Second, it doesn't make sense to have DISTINCT clauses in queries that are UNION-ed together. A UNION has to do a sort to remove duplicates already.
    Third, the two queries you are UNIONing together have to return the same number of columns, with the same names, in the same order.
    You probably want something like
    INSERT INTO new_table( col1, col2, col3, col4, col5 )
      SELECT 'ABC'  col1,
             a.colA col2,
             a.colB col3,
             a.colC col4
             a.colD col5
        FROM table1 a
      UNION
      SELECT 'ABC'  col1,
             b.colA col2,
             b.colB col3,
             b.colC col4
             NULL   col5
        FROM table2 bJustin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Inserting data into database using service callout

    Hi,
    Im using 3 service callout for calling 3 database projects in osb. Im getting output from first two service call outs. In last service callout i have to insert data into data base which is output from service callout. im getting fault while inserting data. Can any body help me with any samples for inserting data into data base which is output from another service callout
    BEA-382513: OSB Replace action failed updating variable "body": com.bea.wli.common.xquery.XQueryException: Error parsing XML: {err}XP0006: "element {http://www.w3.org/2003/05/soap-envelope}Body { {http://www.w3.org/2004/07/xpath-datatypes}untypedAny }": bad value for type element {http://xmlns.oracle.com/pcbpel/adapter/db/POC/NRICHMENT/}OutputParameters { {http://www.w3.org/2001/XMLSchema}anyType }

    Hi prabu,
    I tried with several inputs but im getting same error. How to map to data base input of third service call out with output values of second service call out?
    Any sample blogs

  • Problem inserting data into database (increment problem)

    I have a servlet page that gets various data from a bean and executes multiple SQL statements to store this data. Beacuase i want to insert data into a number of tables that are related with a one to many relationship I am not using the auto increment function in mySQL. Instead i have created a counter bean that increments each time the servlet is involked. I am using this counter to set the primary key ID in the quesiton table that i insert data into and I am alos inserting it into another table as a foreign key which relates a number or records in the outcomes table to one record in the question table. I am havin a few problems getting it to work.
    Firstly the bean counter works but when the tomcat server is shutdown the counter is reset which will cause conflicts in the database no doubt and secondly even though i have not shut my server down i seem to be getting the following error saying there is a duplicate key even though there is no data in the database.
    Here is the exception.
    javax.servlet.ServletException: Duplicate entry '4' for key 1     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
    org.apache.jsp.authoring.question_005fmanager.process_005fquestion_jsp._jspService(process_005fquestion_jsp.java:469)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.sql.SQLException: Duplicate entry '4' for key 1
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
    com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)     com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1366)     com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:952)     com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1974)     com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1897)     com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1758)     org.apache.jsp.authoring.question_005fmanager.process_005fquestion_jsp._jspService(process_005fquestion_jsp.java:140)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    My code is here
    // gets the feedback string parameters
         if(request.getParameterValues("feedbackBox") != null)
                   String[] feedbackList = request.getParameterValues("feedbackBox");
                   questionData.feedback = feedbackList;
         //gets the session username variable
         String insertQuestion1__username = null;
         if(session.getValue("MM_Username") != null){ insertQuestion1__username = (String)session.getValue("MM_Username");}
         //Creates a new mySQL date
         java.sql.Date currentDate = new java.sql.Date((new java.util.Date()).getTime());
         //goes thorugh each element of the scores array and calculates maxScore 
         questionData.maxScore = 0;
         for (int i = 0; i < questionData.scores.length; i++) {
                   questionData.maxScore = questionData.maxScore + questionData.scores;
         //increments count;
         synchronized(page) {
    appCounter.increaseCount();
         int counter = appCounter.count;
         Driver DriverinsertQuestion = (Driver)Class.forName(MM_connQuestion_DRIVER).newInstance();
         Connection ConninsertQuestion1 = DriverManager.getConnection(MM_connQuestion_STRING,MM_connQuestion_USERNAME,MM_connQuestion_PASSWORD);
         questionData.numOutcomes = questionData.choices.length;
         while (counter != 0)
              int questionID = counter;
              PreparedStatement insertQuestion1 = ConninsertQuestion1.prepareStatement("INSERT INTO Question.question (Question_ID, Topic_ID, Description, Image, Author, Created_Date, Max_Score, Question_Type) VALUES (" + questionID + ", '" + questionData.topicID + "', '" + questionData.questionText + "', '" + questionData.questionImage + "', '" insertQuestion1__username "', '" + currentDate + "', " + questionData.maxScore + ", '" + questionData.questionType + "') ");
              insertQuestion1.executeUpdate();          
         Driver DriverinsertQuestion2 = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
         Connection ConninsertQuestion2 = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
         PreparedStatement insertQuestion2 = ConninsertQuestion2.prepareStatement("INSERT INTO Answer.question (Question_ID, Question_Description, Question_Type, Topic, Number_Outcomes, Question_Wording) VALUES ('" counter "', '" questionData.questionLabel "', '" questionData.questionType "', '" questionData.questionType "', '" questionData.topicID "', '" questionData.numOutcomes "', '" questionData.questionText "' ) ");
         insertQuestion2.executeUpdate();
         Driver DriverinsertOutcomes = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
         Connection ConninsertOutcomes = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
         for (int i=0; i < questionData.numOutcomes; i ++)
         PreparedStatement insertOutcomes = ConninsertOutcomes.prepareStatement("INSERT INTO Answer.outcome (Question_ID, Outcome_Number, Outcome_Text, Score, Feedback) VALUES ( '" counter "', '" i "', '" +questionData.choices[i]+ "', '" +questionData.scores[i]+ "', '" +questionData.feedback[i]+ "' ) ");
         insertOutcomes.executeUpdate();
    Does anyone know where i am going wrong or how to fix this problem. I would like to know wheter i am doing this the right way. Is thjis the most practical way to use a counter bean or is there a better safer way to do it.
    Suggestions would be mcuh appreciated
    Thanks

    hi Narendran,
        i declared itab as follows
    DATA:      tb_final TYPE STANDARD TABLE OF ztable,
                       wa_final TYPE ztable.    "work area
    i am populating tb_final as follows:
                 wa_final-vkorg = wa_ycostctr_kunwe-vkorg.
                  wa_final-vtweg = wa_ycostctr_kunwe-vtweg.
                  wa_final-spart = wa_ycostctr_kunwe-spart.
                  wa_final-kunwe = wa_ycostctr_kunwe-kunwe.
                  wa_final-kondm = wa_ycostctr_kunwe-kondm.
                  wa_final-kschl = wa_ycostctr_2-kschl.
                  wa_final-hkont = wa_ycostctr_2-saknr.
                  wa_final-kostl = wa_ycostctr_kunwe-kostl.
            APPEND wa_final TO tb_final.
                  CLEAR wa_final.
    here i am not populating Mandt field.
    finally in tb_final am not getting the proper data .
    kindly help me.
    Thanks,
    Praveena

  • Help! Inserting data  into database

    Hi,
    I have problem in inserting new data into database.
    This is my code used.
    PROCEDURE insert_contact IS
    BEGIN
    GO_BLOCK('BLOCK3');
    first_record;
    LOOP
    insert into LIMS_JOB_LEVEL
         (JOB_LEVEL_CODE,JOB_LEVEL_DESC,LAST_UPD_ID,LAST_UPD_DATE)
         values
         ('FAF','FDSAFS','FDSAF','1-1-01');
         EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
         next_record;
    END LOOP;
    END;
    And I cannot insert the data.Can anyone help me to solve this
    problem of mine.
    Thanks a lot.

    I belive this got to do with the date format. There is another
    posting about this after your posting and there are couple of
    good solutions in there for the date formating. Please refer.

  • Insert data into the column which is having null values.

    Hi,
    I have a column called "Classification_CD" .This column is having NULL values.I want to insert the data into this column.
    I tried to write the query as follows. But it is showing the mesg error "SQL Error: ORA-01400 cannot insert NULL into ("ABC"."A_CMP_W"."A_CMP_SEQ_NUM")"
    Can any one please help me out to write query to insert the dat afor this.
    Thanks.

    I think you are taking about updating the null value.So you can do this..
    SQL> select * from table_a;
            ID SCHEDULED MARK                       PRID
             5 07-NOV-10 T05                           7
             6 18-SEP-10 T06                           8
             4 31-JAN-11 T02                           2
             1 18-JAN-11 T01                           2
             2 18-JAN-11 T02
             3 18-JAN-11 T03                           1
    6 rows selected.See that prid is Null for id 2
    SQL> update table_a
      2  set prid =10
      3  where id =2;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from table_a;
            ID SCHEDULED MARK                       PRID
             5 07-NOV-10 T05                           7
             6 18-SEP-10 T06                           8
             4 31-JAN-11 T02                           2
             1 18-JAN-11 T01                           2
             2 18-JAN-11 T02                          10
             3 18-JAN-11 T03                           1
    6 rows selected.
    SQL> But remember while updating u should choose a primary key column in
    where condition so that only desired row or record is updated..
    Regards
    Umesh

  • Invoking  Servlet to insert  data  into database

    I have written a compose page in html which on clicking SEND button has to call a servlet which inserts the values entered in htmlpage int to database .
    Can any one suggest me how it is done.
    thanks....:)

    for inserting data into the database u need to do the following
    1)write the servlet doGet method.Inside it use the object of the HttpServletRequest to retrieve the values entered in the html page.The method getParameter is used for that.If it is going to be a name written in textbox it should be like
    req.getParameter("txtname");
    req being the object of the HttpServletRequest object and txtname the name of the textbox.
    2)Load the driver
    3)Fix the connection
    4)Write a preparedstatement or statement which would insert the value which is requested above
    5)Execute the query.
    thats it
    All the best
    VaijayanthiBalaraman

  • Inserting Data into Database in Popup - Reflecting in a parent panel

    Hi,
    I have a popup. The popup has a display table. The table is populated with rows (from a proxy ws operation, data control). Each row has a ADF link on a column that inserts that particular row into a database table, the popup remains popped, if you will, until you click an ok button.
    Question:
    I wanted to display all the inserted rows into a panel on the parent window once ok is clicked.
    Any ideas?
    I have been reading variants of popup tutorials, yet to implement, thought I would ask..
    Thanks,
    VJ

    Ok. After trial & error, I am able to refresh parent window panel display table with rows that were inserted in popup window.
    As I started with empty database table initially, the rows inserted into database table in popup window, all of them showed up in parent window panel display table.
    However, if there are say 10 rows that have been already added before, how can one bind only the fresh rows inserted in a particular session?
    I am thinking:
    1. Capture the (database) keys for added rows in a say processScope (I read some significance of it) for that request
    2. Iterate in the parent window panel for these keys only....
    Any examples/advice?
    Thank you,
    VJ
    Edited by: VJ on Apr 13, 2011 9:15 AM

  • How to insert data into database. Please help me(Struggling Very much)

    Hi i am having a jsp page which contains some textfields and one button. I have a database table and i have added to my page. The first column of Database table is ID which is of NUMERIC type and it has been set into primary key. And rest of fields are CHAR type. I am using SQL Server 2000. I have to enter the data into text fields and when i submit the add button it must add to the database table. But i am getting error like
    Exception Details: java.lang.IllegalArgumentException SRNI.TABLE1.NAME
    Please i am trying this one from two months. but it is not getting. I have tried alot by studying all tutorials in Java Studio Creator. I have posted many times but i have followed everyones suggestion. Please give me some instances of writing code to the corresponding requirements i have mentioned above.Please explain step by step including simple one also.
    Thanking You in Advance.

    Hi Srinivasan,
    Please check out the Database projects available at:
    http://blogs.sun.com/sakthi/entry/flavors_of_crud_tutorial_projects
    These have been exercised using this tutorial against different databases:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    HTH,
    Sakthi

  • Inserting data into database error

    for your information, i'm using jsp to create my web page. i am inserting sequence number into the database. When first data in insert into database it will show number 1 in the database. when second data in insert in database, it will show number 2 in the database. the data are inserted when user click submit button from the web page.
    i am creating a page name main.jsp. when the user select option from the list bar, it will link to new page. the option value in the list bar are 'sentul view' and 'cityview'. if the user choose 'cityview', it will link to new page that allows user to key in their information. the problem is sequence number was enter wrongly into database. when the first user click submit after selected "city view', sequence in 'cityview' database will increase. then when the other user register 'sentul view', the database sequence will start from number 2 in 'sentul view' database. how to avoid the problem...
    i enclosed some part of the code:
    <%     
         String sql_selectMax = "SELECT max(smb_regr_seq_no) as maxNo "+
                                  "FROM smbyer ";
         Statement stmt_selectMax = conn.createStatement();
         ResultSet rset_selectMax = stmt_selectMax.executeQuery(sql_selectMax);
         while(rset_selectMax.next()){
              reqNo = rset_selectMax.getInt("maxNo");
              out.print (reqNo);
         reqNo = reqNo + 1;
         %>     

    Note: Sequences are a feature provided by the Oracle database.
    That code will not work in MySQL, Access or MS SQL Server.
    And yeah, like the guy said, you need to keep track of a sequence number for each individual table you want to add records to.
    There are a huge number of resources on the internet discussing issues of IDs. Google is your friend:
    http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=database+unique+ids+java
    Cheers,
    evnafets

  • How to insert Date into Database from workbench.

    Hi
    I have requirement where  I need to  insert the currentDate and Time to the database.   Here I am using  as
    At SQL Statement Info Editor ,have like these :
    Type     value
    Date     parse-dateTime(current-dateTime())
    At DB I have Datatype  as DateTime( Using MySQL). Here i am getting error like :
    Caused by: com.adobe.idp.dsc.jdbc.exception.JDBCIllegalParameterException: Type mismatch is found when preparing SQL statement. Expecting type 'date', but got type 'String'.
    Could  any one tell me where I can find  detailed log say hibernate type... where exatly we are  getting error.(Expect jboss's server log).
    Please tell how to  insert the date into the DB ASAP.
    Thanks
    Praveen

    Thanks for   all replies.
    Eventually I  got  the solution  the post
    From the Form (Using DatePicker) , we will get the DateTime  datatype to the Workbench. All  we need to  do is assign the  same to DateTime variable in the workbench and inserting the data to the DB.
    It works.
    Thanks
    Praveen.

  • How to insert date into database table

    Hi,
    i used date navigator in htmlb. i want toupdate date into the database table ystudetn_inf. and also please tell me how to insert that date into table.give me small example in stepby step.

    Hi,
      I am sure you have used htmlb:dateNavigator as follows
    <htmlb:dateNavigator id             = "myDateNavigator"
                               monthsPerRow    = "1"
                               onNavigate      = "myOnNavigate"
                               onDayClick      = "myOnDayClick"
                               onWeekClick     = "myOnWeekClick"
                               onMonthClick    = "myOnMonthClick">
          </htmlb:dateNavigator>
    Trap the onDayClick event in oninputprocessing
    date_event ?= cl_htmlb_manager=>get_data(
                                        request = runtime->server->request
                                             name     = 'inputField'
                                             id       = 'mydate'  ).
    date = datenavigator_event->day.
    and use date value to update your table.
    If found helpfull rewards points.
    Regards,
    Albert

Maybe you are looking for

  • What will happen to the information on iCloud, if I delete the iCloud account on one device?*

    My iPad I have inherited from my wife. I wish to delete her iCloud account on my iPad and connect it to my existing iCloud account. If I delete her iCloud account from my IPad will the information on her iCloud account be disrupted (lost)?

  • RSS feed in XSLT fragment

    I have used David Powers book as a guide to set up RSS feed content in PHP. Works fine but having one problem in showing html as text. <ul><li> Shown on this page on right iFrame - http://www.golftrailusa.com/listcourse.php

  • How to monitor page hit rates?

    I see a lot of references in docs and white papers to cache hit rates for the Parallel Page Engine, but I've not found any documentation on how to monitor this system-wide (only how to turn on portlet statistics and get a manual page-by-page look at

  • Update member  count error for essbase cube

    Whenever i import a cube from essabse into obiee. i get the following error when i click on "update member count" on any member in the Physical layer of the obiee administration. this problem comes even if i import a different cube, meaning this is n

  • N82 Completely Crash, Please HELP!!

    Hi everyone, My N82 is completely crash and I do not know how to fix. I never dropped this phone and never used messily. Because I love this phone since I got it. I tried all possibility to fix. To take out SIM and SD. To reinstall the firmware. I gu