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.

Similar Messages

  • 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 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

  • 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

  • How to insert data into database table from a servlet? Help please.

    From a servlet I want to insert a message with some servlet parameters into an oracle database table by writing 'insert into tablename'. How shall I write the sql statement?

    simple suppose u wanned to insert user name and password into table user_info then this is a simple example .....
    Best Regds
    bondzoro
    [email protected]
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class tester extends HttpServlet {
    Connection con = null;
    public void init(ServletConfig sc){
    super.int(sc);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOE
    try {
    con=DriverManager.getConnection("jdbc:oracle:thin:@database_URL:1521:ORA8","username","pa
    String user = req.getParameter("username");
    String pass = req.getParameter("pass");
    PreparedStatement pst = con.prepareStatement("insert into user_info values(?,?)");
    pst.setString(1,user);
    pst.setString(2,pass);
    pst.executeQuery();
    pst.close();
    con.close();
    }catch(Exception _e){
    _e.printStackTrace(System.err);
    ~

  • How to update data into database from mx datagrid?

    Hello,
         I am developing a native application. I have connected my application using HttpServices i.e. remote objects to spring mvc 2.5 application. I have done inserting and deleting data from database. Now I want to update the records from datagrid itself. I am new to AIR please suggesst me something useful.
         Thanks in advance..

    Likely you're querying only one selected value from the request using HttpServletRequest#getParameter() instead of an array of selected values using HttpServletRequest#getParameterValues().

  • How to insert data in database table

    Hi experts,
                   How to insert data into database table using internal table from function module.

    Hi,
    As per my understanding are you looking for the complete API feature of data insertion into the database using the Locking Mechanism? If yes, then you need to create a Lock Object using the Primary keys of the Primary Table and Secondary Tables. You need to call the lock object first and then you need to make the entry into the table. This principle is based on  'All or None Concept'.
    For the insert Statement Key word you can have a look at the following link:
    http://help.sap.com/abapdocu/en/ABAPINSERT_SOURCE.htm
    Hope this helps.
    Thanks,
    Samantak.

  • How  to  insert data into custom database table from an hcsf

    i want to insert data into database table that i have created from an hcsf.
    example :
    say i have created a table in oracle database and i hav created a hcsf file.now i want that when somebody fills in that hcsf and click submit ,i want that entries should be updated in my database table.
    plzzz reply ASAP(it's urgent)

    you'll need a bit of Java code... extract the data during a check-in filter, and insert it into the database.
    check out the "DataAccess" component in the HowToComponents for query-running examples, and the "DynamicPrefix" component for a check-in filter example.
    I have older copies here:
    http://bezzotech.com/library

  • How to Insert Hastables Into Database Through JDBC

    hi all,
    I have place the Data from the Hashtables Into the Database.I can place it by Iterating through the Hastables.I would Like to Place the Entire Hashtable Itself Into the Database.
    Can Any one tell me how?
    bye.

    Hi,
    Can anyone help me out how to insert image into
    database using struts...with dao n dto classes?If it matters whether or not you are using struts then you might have something wrong.
    Make sure you separate the database logic out.
    I know these types of questions are asked frequently, you might want to search the forum for additional examples.
    Here is a good one:
    http://forum.java.sun.com/thread.jspa?threadID=620455&messageID=3495899

  • 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.

  • Insert Data into Table from TXT or CSV file !!!!!

    Dear All,
    Recently I have started working on APEX. In Oracle Forms, we used to use TEXT_IO for inserting records into tables from txt files. Now I want to do the same thing in apex 3.2. How can I insert data into tables from txt of csv files.
    Waiting of your valuable suggestions.
    With kind regards,
    Yousuf.

    Yousuf
    wwv_flow_files is used by APEX to hold uploaded files.
    If you incorporate a file browse item on you page, browse for the selected file, then submit the page (having the PL/SQL process described as an on suibmit process) then what I detailed should work.
    If you don't need users to have access to this then just go to Home>Utilities>Data Load/Unload in APEX and there is a handy load utility there that does it all for you.
    Cheers
    Ben

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • 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

  • How to insert data into local database from oracle server

    I am new in C#.
    I am trying to design a local database in my C# project and I am trying to sync my database with our oracle server. I can login using oracle server. But I can't insert data into my local database from oracle server.
    anybody can help me ...............
    thanks..............................

    You can use SSIS package for that
    Start a new Integration Services project in Business  Intelligence Development Studio/ SSDT. Add a new SSIS package with a data flow task. Add a OLEDB source to connect to Oracle server and add a OLEDB Destination to connect to your local database.
    Select tables for source and destination. On executing package source data will get transferred to your local database.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Socket Timeout when reading from post stream

    I get the following error when a servlet tries to read an object from the post stream. Is there a way to set any timeout values on, say a socket, or static variable on any weblogic SocketImpl..? Appreciate any help. Thanks- Rama java.io.InterruptedIO

  • TOC with a 2-column look

    I would like to set up a TOC for a book comprising several articles written by various authors, that might look as follows: AUTHOR NAME - (FIXED TAB)- NAME OF ARTICLE - PAGE NUMBER That is, the TOC would look in the end like a 2-column table, the fir

  • Java Desktop ... change "My Computer" lable

    Solaris 10 03/05, with first recommended patch cluster on a SunBlade 1500. In the JDS desktop, there is an Icon labeled "My Computer", and the user (our IT director) wants that to be the host name of the SB1500. But the Rename option is grayed-out, w

  • Adobe X Deletes Install Folder Contents

    Hey, When installing Adobe X, it deletes most of the contents the C:\Windows\Install folder. There are items in this folder that are being used by the system.  Is there a way to get it not to delete this? It is Windows 7. Thanx

  • Unable to Import RAW files

    I have a new Canon G10 camera and have been experimenting. Today I took some RAW format photos. I am currently using OS 10.4.11 iPhoto 6 will not import these files; a window of 'Unreadable Files' is headed by "The following files could not be import