Problem storing preferences

I come from Windows c++ to Java and am used to storing values in the registry. There is a nice replacement for this in java.util.prefs.Preferences.
I can pick up the values when I create the controls, the problem how do I store the values? There may well be a better way, but one method I saw was to use finalize, which is the equivalent of a destructor. I overrode this method and put in a break point ready to catch it in action, and nothing happens. It never reaches my break point.
I'll put in a snippet of my code:
public class ReconPanel extends JPanel {
     private JCheckBox jRawShow = null;
     jPrefer = Preferences.userNodeForPackage(ReconPanel.class);
     private JCheckBox getJRawShow() {
          if (jRawShow == null) {
               jRawShow = new JCheckBox();
               jRawShow.setSelected(jPrefer.getBoolean("raw show", false));
          return jRawShow;
     private void setRegistry() {
          boolean selected;
          selected = false;
          if(jRawShow.getSelectedObjects()!= null) selected = true;
          jPrefer.putBoolean("raw show", selected);
     protected void finalize() {
          setRegistry();
     }First and foremost, why doesn't it hit my breakpoint?
Second, is there a better place to put my setRegistry, as the destructor may be a little too late?
Thanks,
Ilan

import java.awt.Frame;
import java.util.ArrayList;
import javax.swing.JFrame;
* TODO Enter description
public abstract class AbstractApplictionMainFrame extends JFrame implements ExitApplicationProducer {
     //     ------------------------  Non-Public Fields -----------------
     ArrayList<ExitApplicationListener> exitListeners = new ArrayList<ExitApplicationListener>();
     //     ------------------------  Constructors ----------------------
     protected AbstractApplictionMainFrame(){
          GuiUtilities.setLookAndFeel();
     //     ------------------------  Interface Implementations ---------
      * TODO Enter description
      * @param listener
     /* (non-Javadoc)
      * @see utilities.gui.ExitApplicationProducer#addExitApplicationListener(utilities.gui.ExitApplicationListener)
     public void addExitApplicationListener (ExitApplicationListener listener) {
          exitListeners.add(listener);
     //     ------------------------  Public Methods --------------------
     protected void exitApplication() {
          if (exitListeners.size() > 0) {
               for (ExitApplicationListener l : exitListeners) {
                    l.handleApplicationExiting();
          handleExitApplication();
          this.setVisible(false);
          for (Frame f : getFrames()) {
               f.dispose();
          this.dispose();
     //     ------------------------  Non-Public Methods ----------------
     protected abstract void handleExitApplication();
public class exitTest extends AbstractApplictionMainFrame{
     public exitTest() {
          super();
          this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
          initialize();
      * This method initializes this
     private void initialize() {
       this.addWindowListener(new java.awt.event.WindowAdapter() {
             public void windowClosing(java.awt.event.WindowEvent e) {
                  exitApplication();             }
     public static void main(String[] args) {
          Frame frame = new exitTest();
          frame.setVisible(true);
     protected void handleExitApplication(){
       // do main exit processing here
}

Similar Messages

  • Problem storing preferences in a remote (wsrp) portlet

    We have developed a JSR-168 portlet that works as expected when it is deployed as a Java portlet in BEA Workshop, on a WebLogic 9.2 portal server.
    But if we try to run this portlet remote, by running the "JSR168 .war Import Utility", we get an error regarding preferences. If we go to the Portal Admin console and open the portlet under Library\Portlets, we get the following error:
    com.bea.portlet.prefs.spi.PreferenceStoreException: The given portletHandle [JSR168 Portlet] is either invalid, or not accessible or none of the supported portlet containers can handle this portlet.
         at com.bea.wsrp.consumer.adapter.customization.RemotePreferencePersistenceDelegate.getPropertiesInternal(RemotePreferencePersistenceDelegate.java:720)
         at com.bea.wsrp.consumer.adapter.customization.RemotePreferencePersistenceDelegate.getPreferences(RemotePreferencePersistenceDelegate.java:112)
         at com.bea.portlet.prefs.spi.PreferencePersistenceDelegate.getPreferences(PreferencePersistenceDelegate.java:77)
         at com.bea.jsptools.portal.helpers.PortletHelper.getPortletPreferences(PortletHelper.java:1133)
         at com.bea.jsptools.portal.helpers.PortletHelper.doShowDetails(PortletHelper.java:351)
         at portalTools.definitions.portlets.details.DetailsController.getResources(DetailsController.java:82)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    I have tried registering the portlet many times, on two different servers, with the same exception. The portlet works as it should except when trying to store preferences from "edit mode".
    Has anyone else had this problem? Is there something I need to configure in order to support preferences in remote portlets?
    Thanks,
    Anders

    There is no edit mode defined in this portlet.
    Subbu
    Chandra Mouli Parameswaran wrote:
    Here you go!. This is the portlet file on the producer side.
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
    <netuix:portlet definitionLabel="portlet_2" title="ViewQuotesController">
    <netuix:titlebar/>
    <netuix:content>
    <netuix:pageflowContent contentUri="/viewQuotes/ViewQuotesController.jpf"/>
    </netuix:content>
    </netuix:portlet>
    </portal:root>

  • Problem storing music on external hard drive and iTunes recognising the music.

    Hi hope someone is able to help.
    I've set up iTunes on my parents windows Laptop to store all the music on an external hardrive. In preferences and in advanced I altered where the music was located. But unfortunately when they removed the external and went to use it a few days later, iTunes did not recognise where the music was stored.
    There is no music in the iTunes folder on the laptop only on the external.
    I deleted all the music that could not be located...all had exclamation mark.
    Added folder to library, which was from the external hardrive.
    Music re added and they were able to put music on their ipod. However the same has happened again when they removed and reinserted their external. Should I just cut my losses and reput all the music back on the Laptop (makes it very slow, quite alot of it) or am I missing checking or deselecting something in itunes, with it being on an external hard drive.
    Hope to hear back from someone to help.

    If you've split the media folder out to an external drive and then start iTunes while the drive is disconnected iTunes gets out of sorts. It will reset the media folder to the default internal path. Depending on what other devices have been connected the external drive letter may also change from time to time which also confuses iTunes. What works best is to create your iTunes library at the root of the external drive, with the media folder inside. In this confuration if the drive isn't connected or has changed letter, iTunes will stop with an error. You can either cancel, connec the drive, and restart, or in the case of a changed drive letter, simply browse to X:\iTunes\iTunes Library.itl to open it, where X:: is the current letter for the external drive.
    See make a split library portable for details of how to rearrange your library if you've got it working. Alternatively press and hold down shift as you start iTunes, keep holding until asked to choose or create a library, then click create and make the library at X:\iTunes. Move all the media inside X:\iTunes\iTunes Media, then use File Add Folder to Library to import it.
    tt2

  • Problem storing Russian Characters in Oracle 10g

    We are facing an issue in one of our sites which is in Russian Language. Whenever data is submitted with Russian Characters it saves it as Question mark(upside down) in the database. Database is not supporting these characters.The character encoding is done in UTF-8 format from the front end.
    This code use to work fine with Oracle 9i database but after the upgradation to Oracle 10g this problem has started occuring. We have not made any changes to the code after the upgradation of the database.
    How can we resolve this and what are the settings that we can do to make this work fine?

    What is your database character set and national character set?
    SELECT *
      FROM v$nls_parameters
    WHERE parameter like '%CHARACTERSET';Are you storing the data in CHAR/ VARCHAR2/ CLOB columns? Or NCHAR/ NVARCHAR2/ NCLOB?
    Justin

  • Problem storing sessions

    My system is set up to redirect based on the group stored in
    the database. My problem is that my code is not retrieving the
    group and storing it as a session. Here is my code:
    include("config.php");
    session_start();
    $connection = @mysql_connect($server, $dbusername,
    $dbpassword)
    or die(mysql_error());
    $db = @mysql_select_db($db_name,$connection)
    or die(mysql_error());
    $sql = "SELECT * FROM $table_users WHERE usr_username =
    '$username' and usr_password = md5('$password')";
    $result = @mysql_query($sql, $connection) or
    die(mysql_error());
    //get the number of rows in the result set
    $num = mysql_num_rows($result);
    //set session variables if there is a match
    if ($num != 0)
    while ($sql = mysql_fetch_object($result))
    $_SESSION[usrid] = $sql -> usr_id;
    $_SESSION[name] = $sql -> usr_name;
    $_SESSION[username] = $sql -> usr_username;
    $_SESSION[password] = $sql -> usr_password;
    $_SESSION[email] = $sql -> usr_email;
    $_SESSION[verified] = $sql -> usr_verified;
    $_SESSION[datereg] = $sql -> usr_date;
    $_SESSION[phone] = $sql -> usr_phone;
    $_SESSION[cell] = $sql -> usr_cell;
    $_SESSION[fax] = $sql -> usr_fax;
    $_SESSION[group] = $sql -> usr_group;
    $_SESSION[squestion] = $sql -> usr_squestion;
    $_SESSION[sanswer] = $sql -> usr_sanswer;
    $_SESSION[company] = $sql -> usr_company;
    $_SESSION[member] = $sql -> usr_member;
    }else{
    header("location:../no_acess.php");
    if($_SESSION[group] == "admin"){
    $_SESSION[redirect] = "admin/index.php";
    }else{
    $group = $_SESSION[group];
    $_SESSION[redirect] = "lindex.php";
    header("location:$_SESSION[redirect]");
    exit;

    I'm thinking that you are using URL re-writing for session management. This is the method where the session id must be written in the URL string of every request. This is probably where your problem lies. To start you should wrap the value you are passing to the sendRedirect() method in a call to response.encodeURL() to ensure the URL maintains the session id. Also any Javascript code that uses URLs should also use the response.encodeURL() method to encode the URL strings.
    For instance, this is what you should do. In your code find the line that says "sendRedirect(someValue);" and change it to "sendRedirect(response.encodeURL(someValue))". If the Javascript is defined in a static HTML file or a .js file change this file to a JSP and make sure the value passed to the open() function is wrappered in a call to response.encodeURL().
    To further explain what I think the problem may be, you have to understand session management as it is implemented in JSPs/servlets. There are various tutorials on this site that will explain it in detail.

  • Blob Problem (storing Images)

    AOA!
    I am working as a developer in a companey. we made a database for HRMS. In this database there is a table EMPLOYEE with a column PICTURE of type BLOB. We were using oracle 8i initially but when we migrate to oracle 9i, we are facing a problem in image storing. The situation is, database showing ur previously stored images (those have stored in oracle 8i) but when we save a new image in that table or any other table it seams to be saved but cannot retrived. I mean when we issue a query
    SELECT EMP_ID FROM EMPLOYEE WHERE PICTURE IS NOT NULL;
    It shows the new inserted records too (thats shows us that picture has been inserted) but when we issue query from a forms6i application it didnt show any image. In case of report, when we try to query a record which newly inserted with image, it says some thing like REPORT IS UNABLE TO SHOW IMAGE FORMATE etc.
    The situation is for all table and all schema which is indicating us may be it is some thing due to oracle 9i headen technique or due to miss managment by us. we dont have DBA in our companey.
    Please help us in this regard. We will be thankfull to you.
    Usman Rana
    Dont reply to above mantioned email my actual email account is [email protected]

    I think that both your SQL is wrong and your intended use is wrong. According to the SQL reference, the following seems to be a simplified definition that seems to match what you're trying to do. UPDATE &lt;table&gt; SET &lt;column&gt; = &lt;expr&gt;. So PROPERTIES should be a &lt;table&gt; of some kind and X should be a &lt;column&gt; of that table. This changes your PreparedStatement to *"UPDATE PROPERTIES SET X = ? WHERE NAME = ?"* Then you can do ps.setBlob(1, b) and ps.setString(2, ...). Because your statement is DML you must do ps.executeUpdate(). So your code might look something like this.
    Blob b = ...;
    String x = ...;
    ps = c.prepareStatement("UPDATE PROPERTIES SET X = ? WHERE NAME = ?");
    ps.setBlob(1, b);
    ps.setString(2, x);
    int i = ps.executeUpdate();
    The executeUpdate() returns the row count (i.e. number of rows) of your DML statement. Try that and see if it helps.

  • Retaining deleted messages - problem with preference settings (?)

    I have set up my Mailbox Behaviours to
    1) automatically "move deleted message to the Trash mailbox" (this option is selected)
    and
    2) Store deleted messages on the server (IMAP)
    and
    3) Permenantly erase deleted messages when "One month old"
    BUT... for some reason Mail keeps deleting my messages after approx on week. I have tried changing the settings various ways, but can't seem to overcome this problem. There do not appear
    to be any restrictions or rules on my IMAP server side that would be over-riding the MAIL prefs.
    ANYONE have a suggestion or know what my problem is?

    I believe it’s the server, not Mail, who is permanently deleting those messages. Try turning OFF Store deleted messages on the server, so that deleted messages are stored locally instead, or create a new mailbox on the server and do Mailbox > Use This Mailbox For > Trash on it. Manually move messages to the mailbox that was previously being used to store deleted messages on the server (which should appear now with a generic folder icon in the mailbox list) and see whether the messages are still being deleted from there after one week like before, even though as far as Mail goes it’s now a mailbox like any other.

  • Problem storing a secure key on the filesystem

    Hello. I have made a key, and stored this in the file system. But it is not secure.
    I have example code of doing this using password with salt and iterations. But the problem is that I get Illegial key size.
    Can someone please paste code on how you can do this? I hope you have this code lying around. I would very much appreciate it. Even though it doesnt have password, I just want to know how you can securely store a key.
    I know you also can use Cipher.WRAP_MODE, but I don't know which algorithms to use for the cipher. Any help is appreciated.
    Shervin Asgari

    Yes - but it is still almost trivial for any
    competent Java programmer to hack. Even if youcould
    hide the password then all a hacker has to do isto
    modify the class that reads the file so as towrite
    out the decrypted version.so, no solution for the problem of hiding data on the
    client's computer?
    I'm using a software shipped with a license file. I
    have to ask the vendor for a new file when I install
    it on a different PC. You mean that I could decrypt
    that file and learn how to activate new licenses
    simply inspecting the application code?Yes! There seems to be some general opinion that Java is easy to crack and cracking M$ products impossible. All M$ products can be cracked using this approach but since they are not so easy to decompile as Java it is a bit more difficult. There are Java class loaders available that use a dll to hide the Java byte code but once again they just make things a bit more difficult.
    What it comes down to is that if your program (whether Java, C, C++ etc) can decrypt data then all the information to decrypt the data must be contained in your program. A code analysis will reveal the encryption method and the parameter values used.

  • LCDS 2.5.1: Problems storing Date() in database

    Hi all!
    I hope someone is able to help me with with this:
    I've got a [Managed] [RemoteClass] public class Project, that is stored and updated just fine on Microsoft SQL Server, using msbase.jar and mssqlserver.jar from Microsoft.
    However, as I include a Date(), the LCDS complains about not recognizing the data type:
    [Flex 3] 08/07/2008 13:52:30.525 [DEBUG] [Service.Data.Transaction] Started transaction using jndi name: java:comp/UserTransaction
    [Flex 3] 08/07/2008 13:52:30.540 [DEBUG]
    [Service.Data.SQL] SQL Assembler jdbc exception on operation=update-item error=java.sql.SQLException:
    [Microsoft][SQLServer 2000 Driver for JDBC]Unable to determine the type of the specified object.
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
    at flex.data.assemblers.SQLAssembler.setSQLParameters(SQLAssembler.java:1342)
    at flex.data.assemblers.SQLAssembler.updateItem(SQLAssembler.java:1206)
    at flex.data.adapters.JavaAdapter.doUpdateItem(JavaAdapter.java:1659)
    I've tried playing the RemoteClass, extending Date(), trying variations the data-management-config.xml without any success.
    Anyone worked with dates and MSQL?
    Are there newer versions of msbase.jar and mssqlserver.jar? Other ways?
    Regard,
    Vegard

    This is a bit similar to a problem I had about a year ago... I believe my error may differ slightly because I was using the SQL Server 2005 edition of the driver:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=583&threadid =1289201&messageid=4664480
    The workaround I ended up using was not something I was happy with, but this was for a small internal project so it was good enough for me. As I said at the time the solution is "a bit dodgy", and I offered the diffs for the jTDS source but nobody has asked to date. I may still have these somewhere, but they will be for an out of date version of the driver by now.
    I'd suggest contacting Adobe support if you have an agreement in place, perhaps there is a patch or better workaround than I could come up already available.
    Altering the database driver is really not ideal, and if the source to SQLAssembler was available I believe it should be fairly simple to implement a workaround there.
    It may also be worth confirming this still occurs in version LCDS 2.6.

  • Problem: Storing binary data in Xml Cdata section

    The objective : Tranport image using xml
    1. I convert the image to input stream.
    2. store it in an array.
    3. encode the string using Base64 library and get a string
    4.then i store it in xml CDATA section.
    the code snippet is
    public class ImgToXml01 {
         public static void main(String[] args) throws IOException
              File inputFile = new File("C:\\Arup\\ImgXml\\read\\Sample.jpg");
              FileInputStream in = new FileInputStream(inputFile);
              String str="";
              int c;
              while ((c = in.read()) != -1) {
              str+= ""+c;
              String val = util.Base64.encode(str);
              System.out.println(""+val);
              OutputStream fout = new FileOutputStream("img.xml");
              OutputStreamWriter out = new OutputStreamWriter(fout);
              out.write("<?xml version = \"1.0\" encoding = \"ISO-8859-1\"?>\r\n");
              out.write("<Image>\r\n");
              out.write("[CDATA["+val+"]]");
              //out.write("]]>");
              out.write("</image>\r\n");
              out.close();
    When i retrieve it i write the code:
    import org.xmldb.api.base.*;
    import org.xmldb.api.modules.*;
    import org.xmldb.api.*;
    import org.w3c.dom.*;
    import java.io.*;
    import org.xml.sax.SAXException;
    import oracle.xml.parser.v2.*;
    public class CdataToImage01 {
         public static void main(String[] args) //throws IOException
         try{
         String uri="c:\\Arup\\ImgXml\\img1.xml";
         String data="";      
         File file = new File(uri);
         FileInputStream fis = new FileInputStream(file);
         BufferedInputStream in = new BufferedInputStream(fis);      
         DOMParser parser = new DOMParser();
         parser.parse(in);      
         Document doc = parser.getDocument();
         Node r = doc.getElementsByTagName("Image").item(0);          
         NodeList kids = r.getChildNodes();
         if ( kids != null )     {
              for ( int i = 0; i < kids.getLength(); i++ ) {
                   if ( (kids.item(i).getNodeType() == Node.TEXT_NODE) ||
                             (kids.item(i).getNodeType() == Node.CDATA_SECTION_NODE)) {
                             data=kids.item(i).getNodeValue();
              String data1 = util.Base64.decode(data);
              File outputFile = new File("Sample.jpg");
              FileOutputStream out = new FileOutputStream(outputFile);      
              byte[] buff = data1.getBytes();
              InputStream inn = new ByteArrayInputStream(buff);
              int c;
              System.out.println(buff.length);
              while ((c = inn.read()) != -1) {
              out.write(c);
              inn.close();
              out.close();
         catch (SAXException e) {
              System.err.println(e);
              e.printStackTrace();
         catch (Exception ex){
              System.err.println("Exception occured " + ex.getMessage());
              ex.printStackTrace();
    But i am not getting the appropriate result .I get a corrupted image.
    FROM
    ARUP GHOSH

    String str="";
    int c;
    while ((c = in.read()) != -1) {
    str+= ""+c;
    }Your problem is here.
    Let's suppose you just have a trivial 3-byte file containing the bytes 27, 55, and 126. Your program will convert that into the string "2755126". Then you base-64 encode it, etc etc, then you base-64 decode it and (hopefully) produce the same string "2755126". Converting this string to bytes and writing it to a file produces a 7-byte file containing the bytes 50, 55, 53, 53, 49, 50, and 54. Not the same at all. You could prove this to yourself by putting in some debugging statements.
    I don't know how to suggest a fix because it looks to me as if your base-64 utility takes a String as its input. It should take an array of bytes, or an InputStream.
    PC&#178;

  • Problem with Preferences

    Does anyone know why preferences is grey out on the Edge Reflow CC Preview in the menu bar

    Good question. We should ideally just not have it given we don't have any preferences to expose. We will try to have this removed Thanks!

  • Problem storing special characters (\, \n etc.) in the Properties file

    Hello,
    I am trying to store a string that contains special characters like \, \n, which are normally escaped using a \ character. If I try to save the Properties object into a file (using the store() method call), it doesn't store these escape characters as they are. The following is what I am trying to do:
    Properties p = new Properties();
    String samp = "This string will have a \\ and a newline \ncharacter";
    p.setProperty( "sample", samp );
    p.store( new FileOutputStream( "/path/to/my/file" ) );I am trying to achieve the following result:
    sample=This string will have a \ and a newline
    characterBut, instead, I get this:
    sample=This string will have a \\ and a newline \\\ncharacterCan somebody help me with this problem?
    Thanks,

    Thanks for your replies and efforts to help me out. I
    guess there is no solution to my unique problem.
    Basically I need this because one of my values (for a
    key) is a multi-line value. It will probably load
    fine when I use the \ character to delimit multiple
    lines, but when I want to write back the same value
    as multiple lines (using \ and \n characters), I am
    unable to do that. I don't follow, or else if you're saying what I think you are, I disagree.
    Let's say you have a String in your program that contains some \n characters, so if you print that string, say with println, on a Unix terminal, you'll see it on separate lines.
    Now you write that string out to a properties file with store().
    Forget how it looks in the props file. Consider that opaque, a black box.
    Now you use load() to get it back from the properties file. It will be re-created in its original form, so if you print it out on a unix terminal, you'll again see multiple lines. The fact that it's all on one line in the .properties file doesn't affect that.
    Now, if you want it to appear on multiple lines in the props file, then we're back to my previous post--you're breaking the format that load expects.
    At least, that's my understanding of how it works. I might be mistaken, but I think I've tested this very thing in the not-too-distant past.

  • Does java has problem storing floating point numbers?

    Hi just a quick question. I have been programming in java at least 4, 5 year by now and I feel rather comfortable with programming in java. However, just other day I hit problem with java which I was hoping someone on this forum can fill in for me.
    Now please consider following simple statement:
    double d = 3.0 / 5 / 3;
    and lets say I printed this number
    why does java compute it as 0.19999999999999998 rather than 0.2
    and 2.44 � 7.006 as -4.566000000000001 instead of �4.566
    Frankly, until now I never know java behaved this way and it seems so bizarre.
    I�ve wrote similar program in c and perl just see what happens and they produced an expected result.
    Anyway the program I was writing at the time was really trivial stuff and this problem does not need argent solution but I would like know why did is happening and what might be the solution for it.
    Oh, just in case, the version of JDK I am using right now is (build 1.4.2-b28)
    Thanks

    Take a look at some of these links:
    http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2
    http://java.sun.com/developer/JDCTechTips/2001/tt0807.html#tip1

  • Problem storing date in MS Access using JSP

    Hi all,
    Can anyone please help me storing date in MS Access using Java i am getting errors. I think it is probably because MS Access take "date/month". I am entering a string with date and month example
    1st October as "0110". I don't know how to enter a date in MS Access.
    Here is my code.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <HTML>
    <HEAD>
    <TITLE>  </TITLE>
    </HEAD>
    <BODY>
    <%
       String emplno = request.getParameter("emplno");
       String date = request.getParameter("date");
       String proposal = request.getParameter("proposals");
       String network1 = request.getParameter("network");
       String suppassociates = request.getParameter("suppasso");
       String intmngt = request.getParameter("intmgt");
       String client[] = request.getParameterValues("client");
       String client1= request.getParameter("client1");
       String clientunit[] = request.getParameterValues("clientunit");
       String clientunit1=request.getParameter("clientunit1");
       int staffid = Integer.parseInt(emplno);
       double proposalunit=Double.parseDouble(proposal);
       double suppliersunit=Double.parseDouble(suppassociates);
       double networkunit=Double.parseDouble(network1);
       double internalmgtunit=Double.parseDouble(intmngt);
       Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
       Connection con = DriverManager.getConnection("jdbc:odbc:finalmp" );
       String activities= "INSERT INTO StaffActivities (StaffID,Date,ProposalUnit,NetworkingUnit,SuppliersAssociatesUnit,InternalMGTUnit) VALUES (?,?,?,?,?,?)";
       PreparedStatement pstmt = con.prepareStatement(activities);
       pstmt.setInt(1,staffid);
       pstmt.setString(2,date);
       pstmt.setDouble(3,proposalunit);
       pstmt.setDouble(4,suppliersunit);
       pstmt.setDouble(5,networkunit);
       pstmt.setDouble(6,internammgtunit);
       pstmt.executeUpdate();
       //String emplno="hello";
       //String entered_date="hello";
       //int access_date=0;
       //int user_date=0;
       if(pstmt!=null)
         pstmt.close();
       if(con!=null)
         con.close();
    %>  
    </BODY>
    </HTML>

    i hope this can help you
    public static String convertToISOFormat(Date dateTime) {
            // ISO Format: 'YYYY-MM-DD HH:MM:SS'
            String returnValue = fillLeft(String.valueOf(dateTime.getYear()+1900), 4,
                    '0')
                    + "-"
                    + fillLeft(String.valueOf(dateTime.getMonth()+1), 2, '0')
                    + "-"
                    + fillLeft(String.valueOf(dateTime.getDate()), 2, '0')
                    + " "
                    + fillLeft(String.valueOf(dateTime.getHours()), 2, '0')
                    + ":"
                    + fillLeft(String.valueOf(dateTime.getMinutes()), 2, '0')
                    + ":" + fillLeft(String.valueOf(dateTime.getSeconds()), 2, '0');
            return returnValue;
        }

  • InDesign 5.5 Text layout problem--possible preference issue

    I do a lot of book layout and recently upgraded from InDesign CS3 to 5.5. I've encountered a problem when I'm editing the text layout
    When I make changes to one paragraph (i.e. change the spacing above or below a head or change leading in a particular paragraph), InDesign is automatically changing the word/letter spacing in the lines of the following paragraph. For instance, I added some space before a head. InDesign automattically shifted the spacing of words and letters in the first lines of the following paragraph instead of just shifting all of the text down. In another case I changed one word in a paragraph, and the letter/word spacing changed in the following paragraph.
    This is unacceptable and didn't happen in CS3. How can I turn off this "function" ?

    What I think is happening here is that you’re editing a layout done in a prior version.
    When you open it, InDesign honors the prior text composition but the second you start to edit the new text engine takes over.
    You can export the document out of CS3 as INX and open that which will force all the text to recompose at once and you can get it all over with or stick with CS3 to finish up this job.
    Bob

Maybe you are looking for

  • Pass parameters from JSP Dyn Page to WDJ Application

    Hi, I am trying to pass parameters from my JSPDyn Page to WDJ Application. I am using NWDS 7.1 EHP1 My code is : function to_WEBDYNHK()       EPCM.relaxDocumentDomain();       EPCM.doNavigate     ('ROLES://pcd:portal_content/Himanshu.Himanshu/TestDyn

  • Problem in infotype

    I am creating a custom infotype,for which i created my own package.By using this package i created infotype PSnnnn structure,but when im creating infotype characteristics and then saving it,it asks for a package request.On filling the package request

  • PSE 12 frequent crashes

    I'm running Photoshop Elements 12 with Windows 7 on Intel i7-3960x. OS and program are on SSD. Files on HHD. Experiencing frequent Organizer crashes especially while updating faces or scrolling, but it will also crash when it not active (just sitting

  • In a hierarchical query, is it possible for a row to have more than one immediate ancestor?

    Hi Question: In a hierarchical query, is it possible for a row to have more than one immediate ancestor? Answer: No No?  Surely, it's yes? Thanks, Jason

  • Open console when i run java jar file

    greetings all i have a java program that i execute through JCreater. i want if i make its JAR file then its console should be open so that i could see thats printing when i use "System.out.println". is there anyway? right now when i double click my J