Plz. help with strange date insertions in access???

HELLO all,
i noted a strange thing, when i insert into access table the date it swaps the month and day part for some reason in some records .
why is this happening,
plz. help.
code is as follows
Calendar cal = Calendar.getInstance();
                                        cal.add(Calendar.DAY_OF_MONTH,-1);
                                        System.out.println(""+cal.getTime());
          //this swaps                         SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy")
//this swaps too
     //SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
                                        String currentdate = dateFormat.format(cal.getTime()); // formats your date
custom date is dd/mm/yyyy in table

Hi vykalra1,
As far as I know, the way dates (and times) are stored in a Micro$oft Access database has nothing to do with the display format. The format is only used for displaying the date that is stored in the Access table.
A "field" with "Date/Time" datatype in an Access table maps to the "java.sql.Timestamp" class. Therefore, in order to insert a value into a "Date/Time" (Access) "field", you need to create a "java.sql.Timestamp" object. According to the javadoc, the "java.sql.Timestamp" constructor takes a parameter of type "long" (i.e. java primitive type) -- which represents the number of milliseconds since midnight, 1st January, 1970.
Therefore, you don't really need to use "Calendar" or "SimpleDateFormat".
As I understand it, you are trying to insert yesterday's date into your table. Below is an example using a sample table that has two fields -- 'name' and 'updated' -- which (hopefully) will help you. Note how I determine yesterday's date -- using millisecond calculations only.
The below code was compiled and tested on Windows XP with J2SE SDK 1.4.1_02 and Micro$oft Access 2002.
import java.sql.*;
public class JdbcOdbc {
  public static void main(String[] args) {
    Connection dbConn = null;
    PreparedStatement stmt = null;
    String sql = "INSERT INTO Table1 (name, updated) VALUES (?, ?)";
    try {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      dbConn = DriverManager.getConnection("jdbc:odbc:db1");
      stmt = dbConn.prepareStatement(sql);
      stmt.setString(1,"vykalra1");
      long now = System.currentTimeMillis();
      long millisecondsInOneDay = 1000 * 60 * 60 * 24;
      long yesterday = now - millisecondsInOneDay;
      stmt.setTimestamp(2, new Timestamp(yesterday));
      stmt.executeUpdate();
    catch (SQLException sqlEx) {
      System.err.println("Database operation failed.");
      sqlEx.printStackTrace();
    catch (ClassNotFoundException cnfEx) {
      System.err.println("JDBC driver class not found");
      cnfEx.printStackTrace();
    finally {
      if (stmt != null) {
        try {
          stmt.close();
        catch (SQLException sqlEx) {
          System.err.println("ERROR: Failed to close statement");
          sqlEx.printStackTrace();
      if (dbConn != null) {
        try {
          dbConn.close();
        catch (SQLException sqlEx) {
          System.err.println("ERROR: Failed to close DB connection");
          sqlEx.printStackTrace();
}Good Luck,
Avi.

Similar Messages

  • Strange data inserted into table via table trigger

    Hi ,
    There is some strange phenomenon happen occasionally where some tables update records will have a TRIGGER to insert records into a table and once in a while, the record has some strange data inserted which looks like a memory corruption. It is running on 10.2.0.3.
    Does anyone ever encounter this before?
    Strange result:
    PRIM_KEY
    -3.614364951000000000000000000000000E-47
    -3.614364951000000000000000000000000E-47
    Normal result:
    PRIM_KEY
    1137KT
    1137KT
    ana

    Hi,
    What is strange in this? Its not memory corruption. Its just one of the numeric form of representation of number
    -3.614364951000000000000000000000000E-47it means -3.614364951 * 10 to the power of -47.
    Whatever value has been entered into the table depends on your business logic you coded, and user input.
    Regards

  • Plz help me with this data insertion code

    Hi,
    I am listing a code below ,I am able to insert only one row of value.
    Then i get SQLException.General Exception and a Lock record MSAccess file is generated where .mdb file is stored.
    public void throwtodatabase()
    String gameid;
    ResultSet rs=null;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con;
    con=DriverManager.getConnection ("jdbc:odbc:MyData","","");
    Statement stat3=con.createStatement();
    rs=stat3.executeQuery("select * from sudoko");
    while (rs.next()) {
    pctr=pctr+1;
    stat3.close();
    con.close();
    catch(Exception g)
    JFrame ob2=new JFrame();
    JOptionPane.showMessageDialog(ob2,g.toString(), "Message", JOptionPane.INFORMATION_MESSAGE);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con;
    con=DriverManager.getConnection ("jdbc:odbc:MyData","","");
    gameid="G00"+String.valueOf(pctr);
    PreparedStatement stat=null;
    for (int t1=1;t1<=9;t1++) {
    for (int t2=1;t2<=9;t2++) {
    stat=con.prepareStatement("Insert into Sudoko(gameid,row,col,val) values(?,?,?,?)");
    stat.setString(1,gameid);
    stat.setString(2,String.valueOf(t1));
    stat.setString(3,String.valueOf(t2));
    stat.setString(4,String.valueOf(array_map[t1][t2]));
    stat.execute();
    con.close();
    catch(Exception xd)
    JFrame ob2=new JFrame();
    JOptionPane.showMessageDialog(ob2,xd.toString(), "Message", JOptionPane.INFORMATION_MESSAGE);
    }Plz help.Thanx in advance.

    Have this stacktrace
    java.sql.SQLException: General error
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(Unknown Source)
    at Sudoko.throwtodatabase(Sudoko.java:1120)
    at Sudoko.generate_random_boards(Sudoko.java:1064)
    at Sudoko.actionPerformed(Sudoko.java:205)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
    n Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

  • Plz Help With Nokia 5800 XM ...... Plz

    Hi everyone,
    I have nokia 5800 and i like it very much... But i have a problem with it ..... the problem that when i download any thing from nokia OVI Store from my mobile like: Games, apps and videos when download finished and starting to install the games or the apps it's say's: "installation failed" and when i redownload it again nothing change and keep saying "installation failed" ........ and i noted that when i install app ( themes, apps and games ) on my mobile by ovi suite or by file manager it also say's to me "Expired Certificat" even if i signed this apps but it alwyas say's "Expired Certificat"....... for this problem i did: hard reset - format my mobile - format my sd card - update my mobile to v40 - but the problem never stops to return in a few hours ..... then i find out that when i need to install any app on my mobile (by ovi suite or ovi store in my mobile or file manager) i have to switch off the mobile and turn it on again to install what ever i want ...... so Plz help me out
    PS: 1- I have 2 friends having the same problem that i have and they did what i did
           2- my mobile software v. when the problem stated v31
          3- my memory card 8 GB the orginal one
    Thanx and Please Tell Me What to Do
    Bye

    Option 1
    NOTE
    - YOU CAN ONLY INSTALL SIGNED APPLICATION WITH THIS METHOD.
    - IF YOU DONT TAKE BACKUP OF YOUR DATA OR FOLLOW THE EXACT STEPS HERE YOU WILL LOSS ALL DATA.
    1. With the phone switched on, press the power button key once.
    2. Scroll down to and select "Remove E: Memory Card".
    3. Select Yes to remove the memory card.
    4. Press OK and remove memory card from phone.
    5. Press the Dialler on the main screen.
    6. Type *#7370#
    7. Enter security code. Default is 12345 unless it has been changed.
    8. The phone will reset, wait for this to complete and power back on.
    9. Select your country and type in the correct time and date.
    10. Wait for the phone to complete its configurations, you may receive "My Nokia" or tutorial messages.
    11. Power off phone.
    12. Insert the memory card.
    13. Power on the phone.
    14. Wait for the phone to install any pre-loaded content from the memory card.
    15. Phone is ready to install applications, without "Expired Certificate" error message.
    Option 2
    Alternatively use this to apply for .CER and .KEY for signing applications / games.
    Download SignSIS & FreeSigner (Freeware)
    - http://www.2shared.com/file/10095405/d0fd4cfb/Sign​_SIS_GUI.html
    Signing Video Tutorial
    - http://www.youtube.com/watch?v=z0mZ6d1klaU
    Also, please feedback the results as the results could be useful to other members / visitors.
    Thanks & best regards,
    XM
    I'm an Xploit - Please feel free to post your issues, feedbacks in this discussion forum and I'll do my level best to help, otherwise my knowledged friends whom are around willing to help you. Thank you !

  • Need help with recovering data from a truecrypt HDD

    I have done something stupid, I have run fdisk on my truecrypt hdd by mistake, and created 2 new partition. the 1st one on 67mb and the 2sd for the rest of the hdd.
    Can someone plz help me with restoring the data? I am not really sure there to begin.

    Get testdisk.  I use Parted Magic to recover partitions with Testdisk.  So long as you can decrypt the resurrected partitions AND provided you have NOT written to those two partitions after they were fdisk'ed you should be able to recover from this mess.  I really recommend PartedMagic for this sort of thing only because it has a good interface and a lot of other tools in one place.
    Testdisk isn't hard to use and there are mini-tutorials out there if you're really stuck such as these links from our wiki:
    Testdisk and Photorec

  • Help with MM_editCmd.CreateParameter insert syntax please

    In the past (I guess older ASP version maybe?), the
    automatically generated code that DW created using the "insert
    record" wizard allowed for easy editing and debugging within the
    SQL. I just installed CS3 and created a similar page and the code
    used to build the insert statement is quite different.
    Unfortunately, I'm not versed well enough in it yet!
    I can see how the SQL insert is being built:
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_wp_STRING
    MM_editCmd.CommandText = "INSERT INTO test (FName, LName,
    Company, Email, BPhone, BFax, MPhone, Props, regDate, Password,
    MBroker, MBID, Status, ARID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    MM_editCmd.Prepared = true
    ...and then it appears to uses some scripting functions to
    build the values and replace the ?'s in the CommandText line:
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param1", 202, 1, 255,
    Request.Form("FName")) ' adVarWChar
    What I'm struggling with is the values inside each Append
    line (202, 1, 255) and what the relate to AND more importantly, how
    I can insert my own variable here instead of the form field data.
    ex:
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param1", 202, 1, 255, StrMyStringValue)
    ' adVarWChar
    I need help with the syntax. Would it be different if the
    variable holds a number value vs. text (assuming the field it's
    being inserted into hold numbers)
    Also, i USED to be able to add a handly little Response.Write
    before the execute insert line that would write the SQL insert
    statement to the screen and stop so that I could SEE where the
    issues were. I've tried:
    Response.Write(MM_editCmd.Parameters)
    Response.Write(MM_editCmd.CommandText)
    Just can't get the SQL text to display. Is the SQL insert
    statement not stored as a variable that i can call?
    Thanks VERY much for any help!

    You can use the concatenate() function to build up your string, as you no doubt know.
    As far as the wildcard goes ... your intention must be to try to SET the call variable and later on test the call variable with an IF node. Is that right?
    You would be able to test parts of the string using the substr() function - which is based on character position. If that is a fixed value that you know, it's easy. If it's not, you can first use the find() function to locate something (like the "_9"), returning the position, and then use the substr() function to pull it off.
    Can you write some pseudo-code here to define exactly your intention? You can set up a dummy script and send a dummy call through using Call Tracer and watch the output to see how your code is working.
    Regards,
    Geoff

  • Plz help with deploying applet that uses SSL

    Hi, maybe this is not the adecuate forum but ive already tried in others and i got no answer.
    Im trying to use a certificate with my applet ( tha sends a lot of info to the server and also connects to another hibernate db) but im getting this error:
    Server side:
    username is: Panda
    Registered the SSLServerSocket on port 6969
    Listening ....
    ---- Got a connection from a client
         this is an unknown client
    !!!!!!Error in reading or writing from/to the client:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
         at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
         at sun.nio.cs.StreamDecoder.read(Unknown Source)
         at java.io.InputStreamReader.read(Unknown Source)
         at java.io.BufferedReader.fill(Unknown Source)
         at java.io.BufferedReader.readLine(Unknown Source)
         at java.io.BufferedReader.readLine(Unknown Source)
         at PaqueteServidor.Server$handleRequest.run(Server.java:130)
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(Unknown Source)
         at PaqueteServidor.Server.printClientCerts(Server.java:47)
         at PaqueteServidor.Server.run(Server.java:100)
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
         at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
         at sun.nio.cs.StreamDecoder.read(Unknown Source)
         at java.io.InputStreamReader.read(Unknown Source)
         at java.io.BufferedReader.fill(Unknown Source)
         at java.io.BufferedReader.readLine(Unknown Source)
         at java.io.BufferedReader.readLine(Unknown Source)
         at PaqueteServidor.Server$handleRequest.run(Server.java:130)
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(Unknown Source)
         at PaqueteServidor.Server.printClientCerts(Server.java:47)
         at PaqueteServidor.Server.run(Server.java:100)
    Client side:
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
         at Interfaz.InterfazMovil.init(InterfazMovil.java:89)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
         at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
         at sun.security.validator.Validator.validate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown Source)
         ... 14 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
         at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
         at java.security.cert.CertPathBuilder.build(Unknown Source)
         ... 19 more
    19:40:34,444 INFO Environment:464 - Hibernate 3.0.5
    19:40:34,444 INFO Environment:477 - hibernate.properties not found
    19:40:34,444 INFO Environment:510 - using CGLIB reflection optimizer
    19:40:34,454 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
    19:40:34,645 INFO Configuration:1110 - configuring from resource: /bd/hibernate/hibernate.cfg.xml
    19:40:34,645 INFO Configuration:1081 - Configuration resource: /bd/hibernate/hibernate.cfg.xml
    19:40:35,045 ERROR XMLHelper:59 - Error parsing XML: /bd/hibernate/hibernate.cfg.xml(21) The content of elements must consist of well-formed character data or markup.
    19:40:35,045 ERROR Configuration:1172 - problem parsing configuration/bd/hibernate/hibernate.cfg.xml
    org.dom4j.DocumentException: Error on line 21 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
         at org.dom4j.io.SAXReader.read(SAXReader.java:482)
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
         at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
         at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
         at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
         at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Nested exception:
    org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.dom4j.io.SAXReader.read(SAXReader.java:465)
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
         at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
         at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
         at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
         at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    %%%% Error Creating SessionFactory %%%%
    org.hibernate.HibernateException: problem parsing configuration/bd/hibernate/hibernate.cfg.xml
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1173)
         at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
         at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
         at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
         at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: org.dom4j.DocumentException: Error on line 21 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
         at org.dom4j.io.SAXReader.read(SAXReader.java:482)
         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
         ... 6 more
    java.lang.NullPointerException
         at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:59)
         at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
         at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Plz help and thx in advance.

    I know I didn't get round to replying but no need to post it so many times.
    http://forum.java.sun.com/thread.jspa?threadID=666870
    http://forum.java.sun.com/profile.jspa?userID=543817
    http://forum.java.sun.com/thread.jspa?threadID=669965
    http://forum.java.sun.com/profile.jspa?userID=543817
    http://forum.java.sun.com/thread.jspa?threadID=669975
    http://forum.java.sun.com/thread.jspa?threadID=669973
    Could it be that the server and client need to open different keystores?
    http://forums.java.sun.com/thread.jspa?threadID=573918&messageID=3272683
    reply 7
    My example given before should work on different machines, try to export the server key and import it into the
    client keystore. Export the client key and import in the server keystore if you want the server to authenticate
    the client.
    http://forum.java.sun.com/thread.jspa?threadID=666870
    reply 4
    Check the method getSSLSocketFactory in the applet, that will open a keystore for you.

  • Problem with Comparing Dates in MS Access

    Hai Friends
    I am using MS ACCESS 2000 Database
    I am using the following sqlString in AWT Frame class to fetch the date from MS ACcess Database
    I heard that while comparing with >= or <= we need to include # symbol between the date.
    I was tried by using #. But i am not able to get the results.
    please see the sql query and give me the solution.
    Thanksinadvance
    Yours
    Rajesh
    if(Enddate.getText().trim().equals(""))
    sqlString = "select * from data_comm_err where log_date >= '" + Startdate.getText() + "'";
    if(Startdate.getText().trim().equals(""))
    sqlString = "select * from data_comm_err where log_date <= '" + Enddate.getText() + "'";
    }

    non-proprietary query(portable):
    PreparedStatement ps = con.prepareStatement("select * from data_comm_err where log_date <= ? ");
    ps.setDate(1,new java.sql.Date(Startdate.getTime()));
    ResultSet r  = ps.executeQuery();
    ....note: for clarity and good programming style, don't capitalize the first letter of a variable(Startdate)
    Jamie

  • Need help with saving data and keeping table history for one BP

    Hi all
    I need help with this one ,
    Scenario:
    When adding a new vendor on the system the vendor is suppose to have a tax clearance certificate and it has an expiry date, so after the certificate has expired a new one is submitted by the vendor.
    So i need to know how to have SBO fullfil this requirement ?
    Hope it's clear .
    Thanks
    Bongani

    Hi
    I don't have a problem with the query that I know I've got to write , the problem is saving the tax clearance certificate and along side it , its the expiry date.
    I'm using South African localization.
    Thanks

  • Need help with Rollback data if there is error in Data load

    Hi All,
    We are trying to load data to Oracle 11g database. We want a trigger, procedure or something like that to rollback the data if there are errors in load. Is it possible to do rollback after all the records has been parsed ? So if we try to load 100 records and if there are 30 records with error, we want to rollback after all the 100 records are parsed.
    Please advice.

    >
    Thanks for the suggestion. I'll try that option. So currently we are only loading data that is validated and erroneous records are rejected using trigger. So we don't get any invalid data in table. But Now users are saying that all the records should be rejected if there is even one error in the data load.
    >
    I generally use a much simpler solution for such multi-stage ETL processes.
    Each table has a IS_VALID column that defaults to 'N'. Each step of the process only pulls data with the flag set to 'Y'.
    That allows me to leave data in the table but guarantee that it won't be processed by subsequent stages. Since most queries that move data from one stage to another ultimately have to read table rows (i.e. they can't just use indexes) it is not a performance issue to add a predicate such as "'AND IS_VALID = 'Y'" to the query that accesses data.
    1. add new unvalidated data - automatically flagged an invalid by default of 'N" on IS_VALID column
    2. run audit step #1 - capture the primary key/rowid of any row failing the audit.
    3. run audit steps #2 through #n - capture error row ids
    4. Final step - update the data setting IS_VALID to 'Y' only if a row passes ALL audits: that is, only if there are NO fatal errors for that row captured in the error table.
    That process also allows me to capture every single problem that any row has so that I can produce reports for the business users that show everything that is wrong with the data. There are some problems that the business wan't to ignore, others that can be fixed in the staging tables then reprocessed and others that are rejected since they must be fixed in the source system and that can take several days.
    For data that can be fixed in the staging tables the data is fixed and then the audit is rerun which will set the IS_VALID flag to 'Y' allowing those 'fixed' rows to be included in the data that feeds the next processing stage.

  • Help with a Date variable

    I'm creating a jscript to automatically rename a file the current days date, but i can't figure out how to get it to put a zero in front of days/months that are single digits. Can anyone help me real quick? Heres the code i already have, pay no attention to the "dh" part, it has to be there:
    var todayFileName = "dh" +
    today.getFullYear() + "" +
    today.getMonth() + "" +
    (today.getDate()+1); + " " +

    This little javascript function should help.
    Note that it is only meant to work with valid dates. Putting in a -7 for the parameter will result in something not so nice :-)
    function twoDigitNo(no){
        return  (no < 10) ? "0" + no : no;
      }Cheers,
    evnafets

  • I need help with higrah date

    hii, all
    i would like to compare between this date
    CREATE TABLE HR.TEST_CHECK_IN
      (CHECK_IN  DATE);
    INSERT INTO DATE VALUES ('01/3/1433');
    INSERT INTO DATE VALUES ('02/3/1433');
    INSERT INTO DATE VALUES ('03/3/1433');today in hijrah date is 28/2/1433
    when i write this code it's working fine
    SELECT TO_DATE(CHECK_IN) ,(TO_CHAR(sysdate+1,'DD-MM-YYYY','nls_calendar=''arabic hijrah''')) HIJRAH
    FROM   TEST_CHECK_IN
    WHERE  TO_DATE(CHECK_IN) >(TO_CHAR(sysdate+1,'DD-MM-YYYY','nls_calendar=''arabic hijrah'''))
    RESULT
    TO_DATE(CHECK_IN)         HIJRAH    
    01/03/33                  28-02-1433
    02/03/33                  28-02-1433
    03/03/33                  28-02-1433
    when i use this code with oracle form builder 10 g he give me this error in run time
    frm-40735 ora 01843
         IF TO_DATE(:ROOM_DETAILS.CHECK_IN)>(TO_CHAR(sysdate+1,'DD-MM-YYYY','nls_calendar=''arabic hijrah''')) THEN
              UPDATE ROOMS
              SET    WAITING = 'Y',
                     OCCUPIED= NULL
              WHERE  ROOM_ID = :ROOM_DETAILS.ROOM_ID;
         END IF;
    when i change my code to
    SELECT TO_CHAR(CHECK_IN) ,(TO_CHAR(sysdate+1,'DD-MM-YYYY','nls_calendar=''arabic hijrah''')) HIJRAH
    FROM   TEST_CHECK_IN
    WHERE  TO_CHAR(CHECK_IN) >(TO_CHAR(sysdate+1,'DD-MM-YYYY','nls_calendar=''arabic hijrah'''))
    RESULT --> NULL
    TO_CHAR(CHECK_IN) HIJRAH    
    ----------------- ----------

    And I would suggest that you use consistent datatypes in your tables when you test.
    You have a test table that uses a DATE datatype:
    CREATE TABLE HR.TEST_CHECK_IN
      (CHECK_IN  DATE);
    INSERT INTO DATE VALUES ('01/3/1433');
    INSERT INTO DATE VALUES ('02/3/1433');
    INSERT INTO DATE VALUES ('03/3/1433');And a query that has ':ROOM_DETAILS.CHECK_IN' which may be a VARCHAR2.
    Also you say you tried 849733's suggestion and used 'WHERE TO_DATE(CHECK_IN,'DD-MM-YYYY') ' and go no rows but this TO_DATE with a format string is the same as your original code so would have given the same three rows.

  • Need some help with strange sounds in Logic Pro 8

    Hi!
    I need some help with a problem I have in Logic Pro 8.
    When I have arrange window open, suddley strange high tones starts to make noise in my headphones. I don't know where these sounds comes from or why, but I need some help to get them away. Should I just try to contact Apple?
    Martin

    Hi Martin
    Welcome to the forum. Give everyone here some more info about your set up otherwise it may be difficult to figure out what is wrong.
    Which mac?
    Which OS?
    any hardware devices?
    if you are listening through headphones using the built in audio from the mac, you may be hearing fan noise or a hard drive spin noise.
    Don

  • Doesnt allow me to choose pressure in the brush properties plz help with pic

    Hi, I have a problem in adobe illstrator CS4
    it doesnt allow me to choose pressure or other properties in the brush properties it only allows me choose Fixed and Variable and it makes the colour of othe words like pressure silver so i cant select it from the menu and here is a picture for the problem
    PLEEEEEEEEEEAAAAAAAAAAAAASE help me i really need to know how to solve this problm and by the way i tried on the same computer with windows xp and windows 7 but the problem remains

    i dont have a tablet i ink with the mouse and i see in video tutorials when u ink sketches after u scan them on the computer and the dont say that u must have a tablet like in this video
    http://www.youtube.com/watch?v=DM96tEAnbGs
    plz help me

  • Plz help with a java app

    Dear experts,
    I have a java application in form of a running thread that periodically does an activity ie running a BAPI in
    SAP.I like to schedule this application at evening time.
    Problem is that incase somebody remotely login to this Windows server using RDP and leave an open RDP session,
    two instance starts one on RDP and other on console.
    Now to overcome this problem i devised a solution myself that incase application detects session is remote
    then it should exit itself. This is mentioned in forum undergiven.
    http://forums.sun.com/thread.jspa?threadID=5410674&messageID=10835701#10835701
    My perception behind carrying out this development was that incase session starts in remote then
    app will automatically close and finally letting running only in console.
    Now what happens is that scheduled task doesnot start at all on console ,incase console as well as RDP are open.
    Instead it starts only on RDP failing instantly.So in nutshell,task doesnot start at all.My app log say that
    service tried to open in remote session and got closed.Plz help as i have no way out.
    My second question is that if i schedule task using RDP on remote server,will it run on Remote,console or both
    of them.
    Regards,
    Aditya.

    Adi1000 wrote:
    My app also generates a .lock file and make sure that only one instance is running.Still problem remains unresolvedAnd combining your other thread with the word "also" from this post just exacerbates your "problem". Also, the "lock" file was not to prevent two simulteneous runs (that leads to very distasteful race condition), but rather to prevent two runs within a set period of time when combined with the ServerSocket approach to prevent simulteneous runs.

Maybe you are looking for