Is it my java or my SQL that is giving me this error???

im trying to push a value from a jsp to a database. it is a date. i have it declared as a String in my java
  private String closed_date = "";
  public void setClosedDate(String closed_date)
    this.closed_date = closed_date;
  public String getClosedDate()
    return closed_date;
  }here is the jsp page where the user enters the date
<input type="text" name="dateClosed" size="10" value="<%=rec.getClosedDate()%>" onKeyPress="return noEnter()">and here is the second jsp where the user is notified that the insert was submitted
    String dateClosed = request.getParameter("dateClosed");
    rec.setClosedDate(request.getParameter("dateClosed"));
    //rec.setClosedDate(Date.valueOf(request.getParameter("dateClosed"))); --- for testing
    System.out.println(dateClosed  + " dateClosed"); //for testingand finally here is my other java file with my sql statement and method
public static final String insertDateQuery =
" insert into Dates " +
" ( " +
" ID, CLOSED_DATE, NAME " +
" ) " +
" VALUES " +
" ( " +
" ID_SEQ.NEXTVAL, to_char(to_date(?,'yyyy-mm-dd'),'mm/dd/yyyy'),? " + // is this my problem??? my SQL to_char or should i be doing something in my java to parse???
public synchronized boolean insertDate(RecDateBean rec)
try
        makeConnection();
        ps = conn.prepareStatement(insertDateQuery );
        //ps.setInt(1, rec.getID());//pk -- SEQ.NEXTVAL
        ps.setString(1, rec.getClosedDate());
        ps.setString(2, rec.getName());
        ps.executeUpdate();
        conn.commit();
      }//try
      catch(Exception e)
        System.out.println("Exception:" + e.toString());
        e.printStackTrace();
      }//catch
      finally
        try
          releaseConnection();
        catch (Exception e){}
      }//finally
      return true;
  }//insertDatewhere am i not parsing that i can not enter this date into the database????any suggestions
thanks in advance annie :)
this is the error i get when i run the code
java.sql.SQLException: ORA-01843: not a valid month

so if i use the formatter
  private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd");
i would place it in my java and then change my vars from Strings to Dates
private Date closed_date = null;
  public void setClosedDate(Date closed_date)
    this.closed_date = closed_date;
  public Date getClosedDate()
    return closed_date;
public String getClosedDateFormat()
    if (closed_date == null)
      return "";
    else
      return dateFormat.format(closed_date);
like this and then in my jsp call the
value="<%=rec.getClosedDateFormat()%>"
and still set like this
    String dateClosed = request.getParameter("dateClosed");
    rec.setClosedDate(Date.valueOf(request.getParameter("dateClosed")));
and in my java change my setString to setDate
ps.setDate(2, rec.getClosedDate()); or getClosedDateFormat????

Similar Messages

  • I am trying to update my iPhone software but to do so I needed to update iTunes.  When I try to do that, I keep getting this error message" "There is a problem with this Windows Installer Package. A program required for this install to complete could not

    I am trying to update my iPhone software but to do so I needed to update iTunes.  When I try to do that, I keep getting this error message" "There is a problem with this Windows Installer Package. A program required for this install to complete could not....

    Try the following user tip:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • What is it about InDesign CS5 that someone would get this error message?

    Hi,
    What is is about the .swf file that is generated from the InDesign CS5 interactive workspace that someone would get the following error message when they go to view the site I created?
    "This file may contain newer information that this viewer can support. It may not open or display correctly. Adobe suggests that you upgrade to the latest versions of our Acrobat products blah blah blah."
    The site doesn't seem to work for four Mac users, but works fine for at least one PC user.
    I'm trying to figure out how to save the .swf file down to Flash Player 9, which I've done by exporting a .fla file, then adjusting the Publish setting in Flash CS5. But that throws a wrench into the works...all the animations go haywire by continuously looping and the scale of all the text elements on the first page is much larger than it should be.
    Thanks, Steve

    John Black3 wrote:
    Many of my songs in my iTunes Library no longer play.  I get this error message: "The song xxx could not be used because the original file could not be found. Would you like to locate it?
    this usually happens when a user moves or deletes files in the finder - a sure way to upset iTunes.
    did you move or delete files in the finder ?
    I cannot locate the song.
    if you let iTunes manage your library, all your content will be in <MacintoshHD>/users/<yourname>/music/iTunes/iTunes music (or media)/music. did you look there ? tried a spotlight search ?
    if the files are really gone, and have been purchased from the iTunes store, see Downloading past purchases from the App Store, iBookstore, and iTunes Store.

  • I can't uninstall Bonjour from my computer.  It keeps giving me this error message "The installation source for this product is unavailable. Verify that the source exists and that you can access it."

    I have been trying to upgrade to the new iTunes and it wont let me beacuse it cant find the installation source. So I tried to uninstall everything manually, and it wont even let me do that!

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another install. Does it go through this time?

  • TS3694 I have a 3g phone that is giving me an error message 1645. How do I fix this unit, all it will do is show the apple logo?

    I have a 3gs iphone that shows nothiing but the apple logo. I tried resttoring it and there was an error message that came up showing error # 1645 which does not exist in the troublshooting section. Can you help?

    Check the "Error 1604" section here:
    iTunes: Specific update-and-restore error messages and advanced troubleshooting

  • Just recently iTunes has been giving me this error message: "iTunes helper was not installed correctly." And then another message on top of that: "iTunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 14001)

    I have tried everything ....I need step by step instructions because I need my itunes back up and running! thanks

    im getting the same error,but the update windows .NET framework is still not working, downloaded 2 Microsoft .net framework as suggested by apple support KB article, no go, didnt try creating a new user yet but since its still not working as tested its no use.please help need to update get my iTunes back and update my devices to iOS 5. reinstalled Quicktime and give me error : Please install Apple Application Support.  TWO days now im getting crazy. no itunes no Quicktime, possiby no apples in the future

  • How can I find out what is causing this error in SQL Developer Data Modeler

    Friends,
    I am trying to import entities into into SQL Developer Data Modeler from Oracle Designer 10.1.2.3.
    In case of need I perform these steps to perform the import:
    File --> Import --> Oracle Designer Model --> Select database connection --> Select work area --> select application system --> select one entity --> Click finish --> Import starts
    During the import process I see an alert dialog box with the message:
    There are errors in import - check Log file Clicking Ok dismisses the alert box and I see the following summary screen:
    Oracle SQL Developer Data Modeler Version: 2.0.0 Build: 584
    Oracle SQL Developer Data Modeler Import Log
    Date and Time: 2010-08-09 14:27:26
    Design Name: erdtest
    RDBMS: Oracle Database 10g
              All Statements:           32
              Imported Statements:      32
              Failed Statements:           0
              Not Recognized Statements:      0The Entity is then displayed in the Logical View within SQL Developer Data Modeler.
    Upon checking the log file I see the following entry:
    2010-08-09 13:50:34,025 [Thread-11] ERROR ODExtractionHandler - Error during import from Designer Repository
    java.lang.NullPointerException
         at oracle.dbtools.crest.imports.oracledesigner.logical.ODORelation.createArcs(Unknown Source)
         at oracle.dbtools.crest.imports.oracledesigner.logical.ODORelation.generate(Unknown Source)
         at oracle.dbtools.crest.imports.oracledesigner.ODExtractionHandler.generateDesign(Unknown Source)
         at oracle.dbtools.crest.imports.oracledesigner.ODExtractionController$Runner.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:619)Can anyone shed any light on this error?
    Thanks in advance for any help you may be able to provide.

    No this helps a lot. It's not strange. Firstly, in a versioned repository you should see Private Workareas and Shared workareas, so your workarea may be in either of these. It won't be in the Global Shared Workarea, as this only for non-versioned repositories. (I like to open the RON by selecting the full Repository, that way I can see the private and shared worlareas and the configuration and containers all in the same tree.
    Now your workarea is defined by a set of rules, so when you expand the workarea in the RON, and select the object, then that's the workarea and object you'll see in the import dialog in the Data Modeler. So if you check it out and check it back in, and can't see it in the RON, then the rule is not seeing this object. (Did you refresh the workarea in the RON?) If you can't see it in the RON, you can't see it in the Data Modeler. If you're working in a versioned repository, you need to work in the specific work area, i.e V27 and this is what you need to select in the Data Modeler.
    It looks like you are selecting the wrong workarea in the Data Modeler.
    Sue

  • Error in Migration Db sql server to sql Azure, how i can fix this errors

    I get an error TOTAL_WRITE is not supported in current version when i try validate my database from sql server migration in to sql azure. How I can Fix this error migrate to sql azure
    Also I git this error sp_spaceused is not supported in current version of Azure SQL Database – Reynel Useche Velasco 22 mins ago
    StoredProcedure [dbo].[p_sizetables] -- 'db_name(' is supported only for the local database. You should test to verify the results are what you want. – Reynel Useche Velasco just now edit
    Reynel Alfredo Useche Velasco

    Hi Reynel,
    I see that you have posted this query on stack overflow.
    I would like to involve our SQL experts in this topic and get the best solution.
    As of now to my knowledge @@TOTAL_WRITE is not supported on SQL Azure.
    In the meantime, you can refer the below links for migrating your database from on-prem to Azure.
    https://msdn.microsoft.com/en-us/library/hh313125(v=sql.110).aspx
    https://msdn.microsoft.com/en-us/library/hh313129(v=sql.110).aspx
    Hope this helps you.
    Girish Prajwal

  • How to call pl/sql that is included with FND call in java jdbc directly?

    in my case, I want to call my procedure that will call EBS FND procedure in java jdbc thin way.
    Actually I can run this procedure in sqlplus very well, but I can't run it in my java code, I found that is caused by FND_GLOBAL.APPS_INITIALIZE. In my opinion, the procedure should be running in same server side, I am confused why the procedure has different way in the client side such as jdbc or sqlplus?
    does anyone use pure jdbc thin to call EBS FND procedure directly, instead of AOLj? Thanks in advance

    before you run any oracle apps APIs you need to set environment.....n environment settings will be done by FND_GLOBAL.APPS_INITIALIZE API.
    From which java application you need to call FND Proc....
    whts the basic requirement ?

  • Java and MS SQL Server 2000 problem, please help

    please help me. I am using java and MS SQL Server 2000, and I'm trying to access and verify the login. I'm getting the following error message: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
    Can any please help in this regard.
    String userNumber = (String)userNumField.getValue();
    char[] userPasswordArray = userPasswordField.getPassword();
    String userPassword = new String(userPasswordArray);
         try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Dikolobe_Data");
                java.sql.PreparedStatement statement = connection.prepareStatement(
                        "SELECT USER_NUMBER, USER_PASSWORD, USER_CLASS, USER_STATUS " +
                        "FROM SYS_USER " +
                        "WHERE (USER_NUMBER = ? AND USER_PASSWORD = ?);");
                statement.setString(1, userNumber);
                statement.setString(2, userPassword);
                java.sql.ResultSet result = statement.executeQuery();
                if(result.next()) {
                    String userStatus = result.getString(4);
                    if(userStatus.equals("logged on")) {
                        String loginErrorMessage = "User with number: " + userNumber + " is already logged on.";
                        javax.swing.JOptionPane loginErrorPane = getNarrowOptionPane(72);
                        loginErrorPane.setMessage(loginErrorMessage);
                        loginErrorPane.setMessageType(javax.swing.JOptionPane.ERROR_MESSAGE);
                        javax.swing.JDialog loginErrorDialog = loginErrorPane.createDialog(null, "Login Error");
                        loginErrorDialog.setVisible(true);
                    else {
                        String userClassification = result.getString(3);
                        if(userClassification.equals("Administrator")) {
                            AdminHomePage newAdminHomePage = new AdminHomePage();
                            newAdminHomePage.setVisible(true);
                        else if(userClassification.equals("Educator")) {
                            EduHomePage newEduHomePage = new EduHomePage();
                            newEduHomePage.setVisible(true);
                        statement = connection.prepareStatement(
                                "UPDATE SYS_USER SET USER_STATUS = ? " +
                                "WHERE USER_NUMBER = ?");
                        statement.setString(1, "logged on");
                        statement.setString(2, userNumber);
                        statement.executeUpdate();
                        dispose();
                }

    Doesn't the following link give you enough information?
    http://www.google.com/search?q=invalid+descriptor+index
    Anyway .. This error means that the given ResultSet column index which you're trying to retrieve the value from is out of the range.

  • Java with PL/SQL

    Hi !
    I hope that someone will be able to answer me. Is there any way to integrate java into PL/SQL to set a LDAP connexion context. In java, we can do something like :
    // Set up the environment for creating the initial context
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial");
    env.put("java.naming.ldap.version", "2");
    // Create the initial context
    DirContext ctx = new InitialDirContext(env);
    I would like to be able to create my context and use it with the DBMS_LDAP in PL/SQL. Is there any way to do it ? Do I have to use DBMS_SESSION.set_context ? I'm new with all those concepts and it is really important...
    Thanks for your help !
    Chantale

    > The problem is that we have a compatibility problem with LDAP. When I try to retrieve information
    in LDAP, I have strange characters that appears instead of accents like é,è,ë or whatever... someone
    in my developement team has the same problem and he solved it using java.naming.ldap.version and put
    it in version 2. The problem is that he developed in Java and I am in PL/SQL. That's the problem...
    No. That is not the problem.
    The problem is that you have no clue what the problem is, and now jump at the first available thing that seems to be a solution for this unknown problem. And who knows just how many other problems this so-called solution will now introduce... never mind whether or not the root cause of the original problem will be solved by this solution.
    Software engineering does not work like this.
    Software engineering says:  Identify the Problem.
      Analyse the Problem.
      Solve the ProblemAll you have identified is a symptom of some problem. A character set issue. How about identifying the actual problem and then solving that problem comprehensively?

  • How to use Java with PL/SQL commands to send an email with attachment

    Apologizes in advance if this is the wrong place to ask the question.
    I need to use Java with PL/SQL commands to send an email with attachment. My java application runs from the command line and does some magic to gather info from an Oracle 11g db. If the DB has sendmail configured, I'd like to send the results of the data gathering as an attachment to the email addresses. I'm not sure how to do this. I've been reading up on on PL/SQL can send email with UTL_SMTP - with attachments. I'm just not sure how to translate that into being triggered by my Java application. Any suggestions or pointers on what I should read would be appreciated.
    Background - I've been programming in Java for 10+ years, but this is my first time using databases. I also have been on these forums for a long time, but lost my profile when it was switched to Oracle.
    Thanks for all help.

    user13726880 wrote:
    The original requirements were put together and given to me, an Oracle newbie. They expected the Java app to use something intrinsic to Oracle and Unix sendmail. To solve my problem, I use a JDBC connection to run some SQL commands. I take that data, format it and send the results by email to the user. By default the requirement is to send it as an HTML attachment using Unix 'sendmail'. So I do that using Runtime exec. I have also added JavaMail functionality as an alternative to sendmail. It works great and as expected.Sounds like a reasonable solution.
    Note however that PL/SQL itself can send email. And PL/SQL can call unix sendmail too.
    However myself I would have done it in java with JavaMail.

  • Calling java from pl/sql in oracle 10g?its very urgent.

    Hi Friends,
    i hve simple java code:
    class Hell
    public static String Hello()
    return"hello world";
    & compile this code using javac & loaded Hell.class in to database using this command
    c:\>loadjava -user chandru/shekar@pulser c:\Hell.class
    & i wrote pl/sql like:
    CREATE OR REPLACE FUNCTION Hell RETURN String as language java name 'Hell.Hello() return java.lang.String';
    i will compile the code & run but at that time this error i am getting:
    ORA-29516: Aurora assertion failure: Assertion failure at eox.c:317
    Uncaught exception System error: java/lang/UnsupportedClassVersionError
    I am using oracle 10g.Plzzzzzzzzz help me.Its very important to for me.
    Is any path i hve to set for oracle 10g database.Plz any one help me.
    regards
    shekar

    Hello here is how I solved the problem
    Let us assume that i try to load the file Hello.Java into the user scott.
    public class Hello {
         public static String world() {
              return "hello world";
    1) Dropjava          
    You must drop the java class if you already have loaded the class onto the server.
    dropjava -u scott/tiger Hello.class
    2) load class on server and let the server compile the source code.
    It is necessary to compile the source code on the server when the server and the local machine have different Java versions. To check which Java version there is running on the client machine open a command prompt and write Java -version
    loadjava -user scott/tiger -resolve Hello.java
    3) Publish stored procedure      
    sqlplus scott/tiger@oracle
    CREATE OR REPLACE FUNCTION helloworld RETURN VARCHAR2 AS                LANGUAGE JAVA NAME 'Hello.world () return java.lang.String';
    4)Call stored procedure      
    VARIABLE myString VARCHAR2(20);
    CALL helloworld() INTO :myString;
    PRINT myString;
    RGDS
    Thomas Winterberg

  • Joining java array with SQL table in a stored procedure

    Hey,
    I am calling a pl/sql stored procedure from a java program passing two arrays (employees) and (departments) as parameters to the procedure. Within the procedure I have stored the arrays in a table of records like this:
    type t_emp_type is record (employee_id number, department_id number);
    type t_emp_tbl_type is table of t_emp_type index by binary_integer;
    Where all elements in employees are stored in the employee_id column and departments are stored in the department_id column. So basically I've got a table like:
    l_employee_tbl t_emp_tbl_type;
    Looped through the arrays and stored the data like:
    for i in 1..p_employees.count loop
    l_employee_tbl(i).employee_id := p_employees(i);
    l_employee_tbl(i).deparment_id := p_departments(i);
    end loop;
    Now I would like to compare my l_employee_tbl with a SQL table in the database. Basically I would like to join my l_employee_tbl table with a SQL table named departments on department_id, returning all department_id:s that was not found in table departments.
    However, it is not possible to select from a user-defined table type. I have also tried to use the table() function and to cast l_employee_tbl, but found out it can't be done with records. And I would really like to use records or some other type where define my PL/SQL data. I know that you should not mix PL/SQL and SQL but in this case I think it is more efficient to try joining these "tables". Does anyone have a solution for this or advice to try something else out? It would be most appreciated.
    Edited by: 963281 on 2012-okt-04 14:25
    Edited by: 963281 on 2012-okt-05 01:53

    963281 wrote:
    I am calling a pl/sql stored procedure from a java program passing two arrays (p_employees) and (p_departments) as parameters to the procedure. Within the procedure I have stored the arrays in a table of records like this:
    type t_emp_type is record (employee_id number, department_id number);
    type t_emp_tbl_type is table of t_emp_type index by binary_integer;Why do you create an associative array?
    Now I would like to compare my l_employee_tbl with a SQL table in the database. Basically I would like to join my l_employee_tbl table with a SQL table named departments on department_id, returning all department_id:s that was not found in table departments. Of course, not possible as the SQL engine does not support PL/SQL user defined types. PL/SQL however support user defined SQL types. Which makes SQL defined types a lot more flexible.
    However, it is not possible to select from a user-defined table type. I have also tried to use the table() function and to cast l_employee_tbl, but found out it can't be done with records. Never mind SQL and PL/SQL - as a generic programming data structure principle. How do you expect being able to cast an associative array (name-value pairs) to a standard array? The two data structures are very different. So I'm puzzled in how you expect to move a non-scalar name-value pair data structure into a non-scalar value only data structure?
    And I would really like to use records or some other type where define my PL/SQL data. Why exactly? If the Java or PL/SQL data structure is populated using SQL data and database data, and wanting to use that data structure in SQL, what is the point? Why pull SQL data into a client data structure at all then - surely it is far more performant and scalable to rather keep that data in the database, and do the joins/selects/filters/etc using SQL?
    There is also the issue of scalability of local data structures in PL/SQL. The PL/SQL engine runs inside an Oracle server process, consuming private process memory on the server. The bigger the data structures used in PL/SQL, the more server memory needs to be allocated to that server process. This does not scale. Especially not if 10 or more such server processes are running the same PL/SQL code and each server needs to grab large chunks of server memory.
    If the data from Java comes from another source (e.g. keyboard, etc), and you need a means of storing this data server-side for use by PL/SQL and SQL. There are 2 basic choices. PL/SQL arrays for smallish amounts of data - and basing these arrays preferable on SQL data types allowing the array to be used by both SQL and PL/SQL engines. If the amount of data is not smallish, then it should be stored in the SQL engine (database) as that is designed for that exact purpose. And if the data is transient, then a GTT (global temp table) structure can be used (and indexed for optimal access).

  • Java extension for SQL Developer 2.1 (SqlEditor)

    Hello,
    we are developing a java extension for SQL Developer. It was working fine in version 1.5.5 but it seems that some of the java classes were changed in version 2.1 so it does not any more. In the SQL editor, we want to have a context menu action that gets the selected SQL statement and calls a database function with it as an argument. Our code looks like
    @RegisteredByExtension("our.developer.extension")
    public final class OurCommand extends Command {
    public int doit() {
    SqlEditor sqlEditor = (SqlEditor)getContext().getView();
    String query = sqlEditor.getView().getSqlStatement();
    sqlEditor.executeSql(query, "");
    //or
    //sqlEditor.getView().scriptRunner(query);
    Unforunately, in SQL Developer 2.1 the class oracle.dbtools.sqlworksheet.sqlview.SqlEditor does not exist. Does anybody know how to write this example for version 2.1? Is there an API documentation (alas, [http://wiki.oracle.com/page/SDK+2.0] is an empty article)?
    BTW, does anybody know how to open the dialog for connecting to a database when sqlEditor.getConnection() is null?

    I got it to work using a BASIC call instead of my normal TNS call.
    We use MS SMS to package the Oracle client and SQL Developer and push it out to users so we don't have people visiting desktops. Also, we use OID to store the entries instead of a tnsnames file so that we don't have to maintain a TNSNAMES file.
    I am testing 2.1 as we would eventually upgrade when it goes GA.
    2.1 seems to be built on Oracle 11g. Issue will be that since 99% of our databases are 10gr2 as well as 100% of our client population will be be forced to upgrade the Oracle client to use 2.1 as we do today without lots of changes for the end user?
    We don't broadcast the information the average user requires for a BASIC connection so that is out for non technical users..
    We have SQL Developer 1.5.5 right now and this is not and issue.
    Hopefully, this will be resolved during EAI for 2.1.

Maybe you are looking for

  • Performance issues with BAPI_PROJECT_MAINTAIN

    Hi, We are facing Performance issues with BAPI_PROJECT_MAINTAIN.Would like to know any suggestions for improving performance. I would also like to know statistics regarding how much time is required to create a project with 3000 activities, 100 WBS e

  • SELECT with pattern CP '50*' is not working on material numbers MATNR

    Hello, I have a specific matchcode for searching on material numbers with a function module as selection method. In this function module, the SELECT clause is built dynamically as bellow.       SELECT (temp3)         INTO CORRESPONDING FIELDS OF TABL

  • Exchange 2013 Reports

    Hello All,  I recently installed SCOM 2012 R2 and have installed the Exchange 2013 management packs however there does not seem to be any good reports that are included with this management pack. I was wondering if anybody has an tutorials on creatin

  • Choosing specific key figure

    Hi all, There are 12 key figures (one for each month) and now I want select one of them in the query for output according to input value. For example, when user entry is 3, in the report will be visible column Z03, for 4 column Z04, etc. How can I ac

  • DB12 is Now Showing Accurate Data ,

    Hi Experts, Kindly Help me to fix the problem. I am Using R/3 Entp . with MS SQL DB. When Checked the Backup status from DB12 and RZ20 it is Showing wrong Information, My backup team Confirmed that they have the Succesful backups. Not sure why it is