Pls help.. Java Expert

1)how do i increase the value of month??
example : 21-3-03 translate to 21-3-03
2)how do i update this value to my database by sql statement??
yup.. thanks in advance!!!

>
I almost felt like lifting a finger to help, just for
a moment, and then I saw that you haven't thanked or
rewarded anyone who replied to your last 5 questions.
Hit and run questioning, so to speak.Good point: http://forum.java.sun.com/thread.jsp?thread=372885&forum=31&message=1582967

Similar Messages

  • Any java experts pls help me in converting attribute to XML formats

    Pls help me oh my god i am a newbie here and i am given this project.
    I had just written a XML doc. which looks like this
    <ConsumerTransfer>
    <TransactionId>
    123:123
    </TransactionId>
    <Billingoption>
    cash
    </Billingoption>
    </ConsumerTransfer>
    I need to make this to attributes like
    private String TransactionId()
    private String BillingOption()
    and so on.....
    I need to convert this attributes to XML format
    can any show me an example or the source codes for this
    Really, I appreciate it.
    JimmyKnot

    For such node level operations I think that DOM would be a good idea. So here you go. Look for some nice tutorial for DOM and you got it.
    salut

  • Java Web Start- Cannot launch Application. Pls help

    HI
    Ia m beginner in java web start. I creaate a simple swing application and try to launch it through web start. But I failed. My application jar file (sample.jar)contains only class files. No menifest file. Then I sign my "sample.jar" file and placed inside tomcat server: "webapps/root/WebStart/Sample". I also placed the "sample.jnlp" file in the above directory.The name of my main class is :"Sample" .Here is the content of sample.jnlp:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+"
      codebase="http://165.231199.164:8080"
    >
    <information>
      <title>Sample Launching Test</title>
      <vendor>FMO</vendor> 
      <homepage href="www.sun.com" />
      <description>Demonstration of JNLP</description>
    </information>
    <offline-allowed/>
    <security>
      <all-permissions/>
    </security>
    <resources>
      <j2se version="1.2+" />
      <jar href="/WebStart/Sample/sample.jar"/>
    </resources>
    <application-desc main-class="Sample" />
    </jnlp>Whenever I try to launch this application from the browser , it shows me following :
    An error occurred while launching/running the application.
    Title: Sample Launching Test
    Vendor: FMO
    Category: Unexpected Error
    RED
    Anybody pls help me here about how to Launch my application. Am I missing something?

    I fixed the porblem by modifying the sample.jnlp file. Here is the latest version:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp codebase=http://[my-ip-address]:8080/WebStart/Sample>
    <href="sample.jnlp">
    <information>
      <title>Sample Launching Test</title>
      <vendor>FMO</vendor> 
      <homepage href="www.sun.com" />
      <description>Demonstration of JNLP</description>
      <offline-allowed/>
    </information>
    <security>
      <all-permissions/>
    </security>
    <resources>
      <j2se version=1.4+ />
      <jar href="sample.jar"/>
    </resources>
    <application-desc main-class="Sample" />
    </jnlp>

  • Pls help   how to check the condition in java server faces.....???

    Hi All
    I have strucked with code pls help....
    How can i check the codition in java server faces.....?
    like in my Application when user provides the in put like some state name in the next page i have to display some url for that state .......if he provide some other state name it will be different url .....pls help me how can i do that,,,,,,???
    thanks in advance..

    There are certainly ways to do that. E.g. using the rendered attribute, using conditional statements in EL, using a specialized getter for that (lazily loaded if necessary), etcetera. But your functional requirement is unclear, so I can't go in detail with that.
    In the future, please try to write normal English sentences. Don't write like SMS talk and save the periods and commas. The more effort you put in your question, the more chance you will be taken for serious and the more effort others will post in their answers.
    Also, in the future, JSF related questions should be posted in the JSF forum.
    Edited by: BalusC on 12-aug-2008 7:47

  • Am not able to run the java program - pls help

    1. I installed java in the below path
         c:\program files\java\jdk1.5.0
         c:\program files\java\jre1.5.0
    I set the path in
         User variable i. variable name: path
              ii. variable value: c:\program files\java\jdk1.5.0\bin
    when I compile it in command prompt-applying javac ? it performed successfully-shows
    options like ?g create all debug info, -g : new Generate no debug info etc.,
    But am not able to run the file. It shows error msg.
    2. I specified the same name for file name & class name.
    3. Java <class name>
         Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
    4. Java ?cp <class name>
         Unrecognized option: -cp.<classname>
         Could not create the Java Virtual Machine
    5. Java ?classpath . <classname>
         Exception in thread ?main?.java.lang.unsupported classversionError: <classname>
         <unsupported major.minor version 49.0
              at java.lang.classloader.defineclass0<native method>
              at java.lang.classloader.defineclass<unknown source>
                   --and many listed below?
    6. Java ?classpath c:\program files\java\jdk1.5.0\bin <class name>
         Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
    7. I re-installed the java, but still the problem continuing.
    pls help... its very urgent

    Is the java class you compiled/calling in the default package? If it is not, you will have to call it by the fully qualified name.
    e.g.
    package com.mycompany.myproject;
    public class MyClass {
        public static void main(String[] args) { }
    }This would be called as "Java com.mycompany.myproject.MyClass" and must contain a main method with signature as above.
    You would have to call this from folder where the compiled classes are located. If using package, you would call from directory at level of top most package so com folder in this example as Java will look at each package name in qualified name and try to traverse directories with those same names to get to .class file matching class name specified. To avoid this, your newly compiled .class files must also be in your classpath.
    Hopefully that helps.
    --Kevin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    Java is no longer included in Mac OS X by default. If you want Java, you will have to install it.
    However, note that you should think twice before installing Java for such a trivial need as looking at stock market quotes. There are other ways to get that information that don't involve Java, and using Java in your web browser is a HUGE security risk right now. Java has been vulnerable to attack almost constantly for the last year, and has become a very popular, frequently used method for getting malware installed via "drive-by downloads." You really, truly don't want to be using it. See:
    Java is vulnerable… Again?!
    http://java-0day.com

  • URGENT!! all the JAVA EXPERTS plssss help me!!

    thanks for replying me....i m actually doing a coursework that i have to submit by next monday 29/4/2002. and i havent finish it yet.... ok .. finally i have finish level 1, now i m doing level two...
    my program in level 2 should :
    a.) Allow the user to specify certain criteria for a room that they wish to book on a particular day. e.g. X number of people, video conferencing, your program should find an appropriate room for them that is free on that day.
    b.) Allow the user to add more rooms to the system and make these available to the user to book.
    c.) Allow a user to attempt to delete a room. The room will only be deleted if it has no bookings.
    d.) Allow the user to ask the system to find the minimum fit room free e.g.
    * the smallest room to hold X people that has a connection to the internet.
    * if the user requests a room for 40 people and there are rooms free for 50 and 60 people, then
    it will allocate them the room for 50.
    i really donno how to do....pls help me....
    there is something wrong in the METHOD --> AddDeleteRoom()
    and i donno how to code the AddNewRoom()
    i need to add more rooms into my array
    u can download these coding .....i got three files, 1 is the main class call CC.java, another 1 is the class filewhich is Rooms.java and the third file is CC.html file.
    dont worry, u can save all the coding in here.... i try b4 it can run.....
    <<save as CC.java>>
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.JApplet;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.JOptionPane;
    public class CC extends JApplet implements ActionListener,ItemListener
    JPanel pnlPane = new JPanel();
    JPanel pnlChoise = new JPanel();
    JPanel pnlButton2 = new JPanel();
    JPanel pnlRoomDisplay = new JPanel();
    JPanel pnlRoom = new JPanel();
    JPanel pnlDisplay = new JPanel();
    JPanel pnlClear = new JPanel();
    JButton btnDisplay = new JButton("Display");
    JButton btnBookRoom = new JButton("Book Room");
    JButton btnDelBookRoom = new JButton("Delete Booking");
    JButton btnDelRoom = new JButton("Delete Room");
    JButton btnAddNewRoom = new JButton("Add New Room");
    JButton btnClear = new JButton("Clear");
    JButton btnRoomQuery = new JButton("Room Query");
    Rooms []room = new Rooms[11];
    String[] Days = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
    int [][] book = new int[11][7];
    public int R, D;
    JLabel lblRoomName = new JLabel();
    JLabel lblCapacity = new JLabel();
    JLabel lblInternet = new JLabel();
    JLabel lblVideo = new JLabel();
    JLabel lblStatus = new JLabel();
    JComboBox cDays= new JComboBox(Days);
    JComboBox cRooms = new JComboBox();
    JTextField txtRoomName1 = new JTextField();
    JTextField txtCapacity1 = new JTextField();
    JCheckBox chkInternet = new JCheckBox("Internet Connection");
    JCheckBox chkVideo = new JCheckBox("Video Conferencing");
    JTextArea txtDisplay = new JTextArea("*****Rooms Detail*****" + "\n",12,30);
    public void init()
    pnlPane.add(pnlChoise);
    pnlPane.add(pnlButton2);
    pnlPane.add(pnlRoomDisplay);
    pnlPane.add(pnlRoom);
    pnlPane.add(pnlDisplay);
    pnlPane.add(pnlClear);
    pnlPane.setBorder(new TitledBorder(new BevelBorder(BevelBorder.RAISED),"Room Booking System"));
    setContentPane(pnlPane);
    AddChoisePanel();
    AddButton2Panel();
    AddRoomDisplayPanel();
    AddRoomPanel();
    AddDisplayAreaPanel();
    AddClearPanel();
    public void AddChoisePanel()
    pnlChoise.setLayout(new GridLayout(1,3,5,5));
    room[0]=new Rooms("Barrington","15","No","Yes");
    room[1]=new Rooms("Carlton","25","Yes","No");
    room[2]=new Rooms("Debyshire","35","No","No");
    room[3]=new Rooms("Edwards","30","Yes","Yes");
    room[4]=new Rooms("Farley","70","Yes","No");
    room[5]=new Rooms("Goodwin","80","Yes","Yes");
    room[6]=new Rooms("Harlow","90","No","Yes");
    room[7]=new Rooms("IlFord","85","No","No");
    for (int i=0; i<8; i++)
    cRooms.addItem(room.rName);
    pnlChoise.add(cRooms);
    pnlChoise.add(cDays);
    pnlChoise.add(btnRoomQuery);
    btnRoomQuery.addActionListener(this);
    cRooms.addItemListener(this);
    public void AddButton2Panel()
    pnlButton2.setLayout(new GridLayout(1,2,5,5));
    pnlButton2.add(btnBookRoom);
    pnlButton2.add(btnDelBookRoom);
    btnDelBookRoom.addActionListener(this);
    btnBookRoom.addActionListener(this);
    public void AddRoomDisplayPanel()
    pnlRoomDisplay.setLayout(new GridLayout(6,2,5,2));
    pnlRoomDisplay.add(new JLabel("Room Name" ));
    pnlRoomDisplay.add(lblRoomName);
    pnlRoomDisplay.add(new JLabel("Room Capacity"));
    pnlRoomDisplay.add(lblCapacity);
    pnlRoomDisplay.add(new JLabel("Internet Connection"));
    pnlRoomDisplay.add(lblInternet);
    pnlRoomDisplay.add(new JLabel("Video Conferencing"));
    pnlRoomDisplay.add(lblVideo);
    pnlRoomDisplay.add(new JLabel("Room Status"));
    pnlRoomDisplay.add(lblStatus);
    pnlRoomDisplay.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED),"Rooms Detail"));
    pnlRoomDisplay.add(btnDelRoom);
    btnDelRoom.addActionListener(this);
    public void AddRoomPanel()
    pnlRoom.setLayout(new GridLayout(6,2,2,2));
    pnlRoom.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED),"Add New Rooms"));
    pnlRoom.add(new Label("Room Name"));
    pnlRoom.add(txtRoomName1);
    pnlRoom.add(new Label("Capacity"));
    pnlRoom.add(txtCapacity1);
    pnlRoom.add(chkInternet);
    pnlRoom.add(new Label(""));
    pnlRoom.add(chkVideo);
    pnlRoom.add(new Label(""));
    pnlRoom.add(new Label(""));
    pnlRoom.add(new Label(""));
    pnlRoom.add(btnAddNewRoom);
    btnAddNewRoom.addActionListener(this);
    public void AddDisplayAreaPanel()
    pnlDisplay.setLayout(new GridLayout(1,1));
    //pnlDisplay.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED),"Rooms Detail"));
    Border pnlDisplayBorder = BorderFactory.createTitledBorder("Rooms Detail");
    pnlDisplay.setBorder(pnlDisplayBorder);
    pnlDisplay.add(txtDisplay);
    public void AddClearPanel()
    pnlClear.setLayout(new GridLayout(1,1));
    pnlClear.add(btnClear);
    btnClear.addActionListener(this);
    public void actionPerformed(ActionEvent event)
    //to call RoomQuery function
    if (event.getSource() == btnRoomQuery){
    AddRoomQuery(); }
    else
    //to call DeleteBookRoom function
    if (event.getSource() == btnDelBookRoom){
    AddDeleteBookRoom(); }
    else
         //to call DeleteRoom function
    if (event.getSource() == btnDelRoom){
              AddDeleteRoom(); }     
         else
         //to call AddNewRoom function
         if (event.getSource() == btnAddNewRoom){
                   AddNewRoom(); }
              else
              //to call ClearTextArea function
                   if (event.getSource() == btnClear){
                   AddClearTextArea(); }
              else
                   //to call BookRoom function
                   if (event.getSource() == btnBookRoom){
                        AddBookRoom(); }
    public void AddRoomQuery()
    R= (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    JOptionPane.showMessageDialog(null, R + " " + D);
    txtDisplay.setText(" *************** Room Status For "+ Days[D] + " *************** " + "\n");
    txtDisplay.append("Rooms" + "\t\t " + " Status");
    for (int t=0; t< (int) cRooms.getItemCount(); t++)
    {  JOptionPane.showMessageDialog(null," is" + cRooms.getItemCount());
    if (book[t][D]==0)
    txtDisplay.append("\n" + ">>" + room[t].rName);
    txtDisplay.append("\t\t " + " Room is Available");
    else
         if (book[t][D]==1)
    txtDisplay.append("\n" + ">>" + room[t].rName);
         txtDisplay.append("\t\t " + " Room Booked");
    JOptionPane.showMessageDialog(null, "end " );
    public void AddDeleteBookRoom()
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    if(book[R][D] == 1)
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room is Available" + "\n");
    book[R][D] = 0;
    else
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room Available"+ "\n");
         book[R][D] = 0;
    public void AddDeleteRoom()
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    JOptionPane.showMessageDialog(null,"Room selected index " + R);
    int intCount =(int) cRooms.getSelectedIndex();
    if (intCount != -1)
    if(book[R][D] == 0 )
    JOptionPane.showMessageDialog(null,"Room "+room[intCount].rName + " had Deleted");
    cRooms.removeItemAt(intCount);
    int i;
    for( i=intCount;i< cRooms.getItemCount();i++)
    JOptionPane.showMessageDialog(null,"Room "+room[i+1].rName + "to");      
    room[i]=new Rooms(room[i+1]);
    JOptionPane.showMessageDialog(null,"Room "+ room[i].rName );
    //cRooms.getSelectedIndex());
    // intCount--;
    else
    if(book[R][D] == 1 )
    JOptionPane.showMessageDialog(null,"Room "+room[intCount].rName+" Can Not be Delete");
    else
    JOptionPane.showMessageDialog(null,"Select A Room To be Delete ");
    public void AddNewRoom()
    JOptionPane.showMessageDialog(null,"Add new room");
    public void AddClearTextArea()
    txtDisplay.setText("*****Rooms Detail*****" + "\n");
    public void AddBookRoom()
    R= (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    if(book[R][D] == 0)
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room is Booked" + "\n");
    book[R][D] = 1;
    else
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room Not Available"+ "\n");
         book[R][D] = 1;
    public void itemStateChanged(ItemEvent itv)
    if( itv.getSource() == cRooms )
    R = (int) cRooms.getSelectedIndex();
    lblRoomName.setText(room[R].rName);
    lblCapacity.setText(room[R].rCapacity);
    lblInternet.setText(room[R].rInternet);
    lblVideo.setText(room[R].rVideo);
    // lblStatus.setText(room[R].rStatus);
    <<save as Rooms.java>>
    public class Rooms
    String rName;
    String rCapacity;
    String rInternet;
    String rVideo;
    // String rStatus;
    Rooms(String a, String b, String c, String d)//, String e)
    rName = a;
    rCapacity = b;
    rInternet = c;
    rVideo = d;
    // rStatus = e;
    Rooms(Rooms r)
    rName = r.rName;
    rCapacity = r.rCapacity;
    rInternet = r.rInternet;
    rVideo = r.rVideo;
    // rStatus = r.e;
    <<saves as CC.html>>
    <html>
    <body>
    <Applet code = CC.class
    width = 600
         height = 510>
    </Applet>
    </body>
    </html>

    The important thing is to put the related functionality in the class Room and not everywhere in the class CC.
    The types of the data member in the class Room are also very important to reflect exactly what they should store.
    Here I post a new version of your files as example of how we can improve your version. It does not implement all the functionality you will need but it is a first step.
    Serge
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.JApplet;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.JOptionPane;
    import java.util.LinkedList;
    public class CC extends JApplet implements ActionListener, ItemListener {
        JPanel pnlPane = new JPanel();
        JPanel pnlChoise = new JPanel();
        JPanel pnlButton2 = new JPanel();
        JPanel pnlRoomDisplay = new JPanel();
        JPanel pnlRoom = new JPanel();
        JPanel pnlDisplay = new JPanel();
        JPanel pnlClear = new JPanel();
        JButton btnDisplay = new JButton("Display");
        JButton btnBookRoom = new JButton("Book Room");
        JButton btnDelBookRoom = new JButton("Delete Booking");
        JButton btnDelRoom = new JButton("Delete Room");
        JButton btnAddNewRoom = new JButton("Add New Room");
        JButton btnClear = new JButton("Clear");
        JButton btnRoomQuery = new JButton("Room Query");
        LinkedList roomList = new LinkedList();
        String[] Days = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
        public int R, D;
        JLabel lblRoomName = new JLabel();
        JLabel lblCapacity = new JLabel();
        JLabel lblInternet = new JLabel();
        JLabel lblVideo = new JLabel();
        JLabel lblStatus = new JLabel();
        JComboBox cDays = new JComboBox(Days);
        JComboBox cRooms = new JComboBox();
        JTextField txtRoomName1 = new JTextField();
        JTextField txtCapacity1 = new JTextField();
        JCheckBox chkInternet = new JCheckBox("Internet Connection");
        JCheckBox chkVideo = new JCheckBox("Video Conferencing");
        JTextArea txtDisplay = new JTextArea("*****Rooms Detail*****" + "\n", 12, 30);
        public void init() {
            pnlPane.add(pnlChoise);
            pnlPane.add(pnlButton2);
            pnlPane.add(pnlRoomDisplay);
            pnlPane.add(pnlRoom);
            pnlPane.add(pnlDisplay);
            pnlPane.add(pnlClear);
            pnlPane.setBorder(new TitledBorder(new BevelBorder(BevelBorder.RAISED), "Room Booking System"));
            setContentPane(pnlPane);
            AddChoisePanel();
            AddButton2Panel();
            AddRoomDisplayPanel();
            AddRoomPanel();
            AddDisplayAreaPanel();
            AddClearPanel();
        public void AddChoisePanel() {
            pnlChoise.setLayout(new GridLayout(1, 3, 5, 5));
            Room[]room = new Room[8];
            room[0] = new Room("Barrington", "15", false, true);
            room[1] = new Room("Carlton", "25", true, false);
            room[2] = new Room("Debyshire", "35", false, false);
            room[3] = new Room("Edwards", "30", true, true);
            room[4] = new Room("Farley", "70", true, false);
            room[5] = new Room("Goodwin", "80", true, true);
            room[6] = new Room("Harlow", "90", false, true);
            room[7] = new Room("IlFord", "85", false, false);
            for (int i = 0; i < 8; i++) {
                cRooms.addItem(room.getName());
    roomList.add(room[i]);
    pnlChoise.add(cRooms);
    pnlChoise.add(cDays);
    pnlChoise.add(btnRoomQuery);
    btnRoomQuery.addActionListener(this);
    cRooms.addItemListener(this);
    public void AddButton2Panel() {
    pnlButton2.setLayout(new GridLayout(1, 2, 5, 5));
    pnlButton2.add(btnBookRoom);
    pnlButton2.add(btnDelBookRoom);
    btnDelBookRoom.addActionListener(this);
    btnBookRoom.addActionListener(this);
    public void AddRoomDisplayPanel() {
    pnlRoomDisplay.setLayout(new GridLayout(6, 2, 5, 2));
    pnlRoomDisplay.add(new JLabel("Room Name"));
    pnlRoomDisplay.add(lblRoomName);
    pnlRoomDisplay.add(new JLabel("Room Capacity"));
    pnlRoomDisplay.add(lblCapacity);
    pnlRoomDisplay.add(new JLabel("Internet Connection"));
    pnlRoomDisplay.add(lblInternet);
    pnlRoomDisplay.add(new JLabel("Video Conferencing"));
    pnlRoomDisplay.add(lblVideo);
    pnlRoomDisplay.add(new JLabel("Room Status"));
    pnlRoomDisplay.add(lblStatus);
    pnlRoomDisplay.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED), "Rooms Detail"));
    pnlRoomDisplay.add(btnDelRoom);
    btnDelRoom.addActionListener(this);
    public void AddRoomPanel() {
    pnlRoom.setLayout(new GridLayout(6, 2, 2, 2));
    pnlRoom.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED), "Add New Rooms"));
    pnlRoom.add(new Label("Room Name"));
    pnlRoom.add(txtRoomName1);
    pnlRoom.add(new Label("Capacity"));
    pnlRoom.add(txtCapacity1);
    pnlRoom.add(chkInternet);
    pnlRoom.add(new Label(""));
    pnlRoom.add(chkVideo);
    pnlRoom.add(new Label(""));
    pnlRoom.add(new Label(""));
    pnlRoom.add(new Label(""));
    pnlRoom.add(btnAddNewRoom);
    btnAddNewRoom.addActionListener(this);
    public void AddDisplayAreaPanel() {
    pnlDisplay.setLayout(new GridLayout(1, 1));
    //pnlDisplay.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED),"Rooms Detail"));
    Border pnlDisplayBorder = BorderFactory.createTitledBorder("Rooms Detail");
    pnlDisplay.setBorder(pnlDisplayBorder);
    pnlDisplay.add(txtDisplay);
    public void AddClearPanel() {
    pnlClear.setLayout(new GridLayout(1, 1));
    pnlClear.add(btnClear);
    btnClear.addActionListener(this);
    public void actionPerformed(ActionEvent event) {
    //to call RoomQuery function
    if (event.getSource() == btnRoomQuery) {
    AddRoomQuery();
    } else {
    //to call DeleteBookRoom function
    if (event.getSource() == btnDelBookRoom) {
    AddDeleteBookRoom();
    } else {
    //to call DeleteRoom function
    if (event.getSource() == btnDelRoom) {
    AddDeleteRoom();
    } else {
    //to call AddNewRoom function
    if (event.getSource() == btnAddNewRoom) {
    AddNewRoom();
    } else {
    //to call ClearTextArea function
    if (event.getSource() == btnClear) {
    AddClearTextArea();
    } else {
    //to call BookRoom function
    if (event.getSource() == btnBookRoom) {
    AddBookRoom();
    public void AddRoomQuery() {
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    // JOptionPane.showMessageDialog(null, R + " " + D);
    txtDisplay.setText(" *************** Room Status For " + Days[D] + " *************** " + "\n");
    txtDisplay.append("Rooms" + "\t\t " + " Status");
    Room aRoom = (Room)roomList.get(R);
    for (int t = 0; t < (int) cRooms.getItemCount(); t++) {
    // JOptionPane.showMessageDialog(null, " is" + cRooms.getItemCount());
    aRoom = (Room)roomList.get(t);
    txtDisplay.append("\n" + ">>" + aRoom.getName());
    if (aRoom.isBooked(D)) {
    txtDisplay.append("\t\t " + " Room Booked");
    } else {
    txtDisplay.append("\t\t " + " Room is Available");
    // JOptionPane.showMessageDialog(null, "end ");
    public void AddDeleteBookRoom() {
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    Room aRoom = (Room)roomList.get(R);
    aRoom.checkOut(D);
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room is Available" + "\n");
    public void AddDeleteRoom() {
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    // JOptionPane.showMessageDialog(null, "Room selected index " + R);
    int intCount = (int) cRooms.getSelectedIndex();
    Room aRoom = (Room)roomList.get(R);
    if (intCount != -1) {
    if (aRoom.isBooked() == false) {
    JOptionPane.showMessageDialog(null, "Room " + ((Room)roomList.get(intCount)).getName() + " had Deleted");
    cRooms.removeItemAt(intCount);
    roomList.remove(intCount);
    } else {
    JOptionPane.showMessageDialog(null, "Room " + ((Room)roomList.get(intCount)).getName() + " Can Not be Delete");
    } else {
    JOptionPane.showMessageDialog(null, "Select A Room To be Delete ");
    public void AddNewRoom() {
    String rName = txtRoomName1.getText();
    String rCapacity = txtCapacity1.getText();
    boolean rInternet = chkInternet.isSelected();
    boolean rVideo = chkVideo.isSelected();
    Room nRoom = new Room(rName,rCapacity,rInternet,rVideo);
    cRooms.addItem(rName);
    int i = cRooms.getItemCount();
    roomList.add(nRoom);
    public void AddClearTextArea() {
    txtDisplay.setText("*****Rooms Detail*****" + "\n");
    public void AddBookRoom() {
    R = (int) cRooms.getSelectedIndex();
    D = (int) cDays.getSelectedIndex();
    Room aRoom = (Room)roomList.get(R);
    if (aRoom.reserve(D) == 0) {
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room is Booked" + "\n");
    } else {
    txtDisplay.setText("*****Rooms Detail*****" + "\n" + "Room Not Available" + "\n");
    public void itemStateChanged(ItemEvent itv) {
    if (itv.getSource() == cRooms) {
    R = (int) cRooms.getSelectedIndex();
    Room aRoom = (Room)roomList.get(R);
    lblRoomName.setText(aRoom.getName());
    lblCapacity.setText(String.valueOf(aRoom.getCapacity()));
    lblInternet.setText(aRoom.getInternet());
    lblVideo.setText(aRoom.getVideo());
    // lblStatus.setText(aRoom.rStatus);
    public class Room {
    public final String YES = "Yes";
    public final String NO = "No";
    private String rName = null;
    private int rCapacity = 0;
    private boolean rInternet = false;
    private boolean rVideo = false;
    private boolean [] booked = { false, false, false, false, false, false, false };
    Room(String name, String capacity, boolean hasInternet, boolean hasVideo)
    rName = new String(name);
    rCapacity = Integer.parseInt(capacity);
    rInternet = hasInternet;
    rVideo = hasVideo;
    public int reserve(int day) {
    if (booked[day] == true)
    return -1;
    booked[day] = true;
    return 0;
    public void checkOut(int day) {
    booked[day] = false;
    public boolean isBooked() {
    for (int i = 0; i < booked.length; i++)
    if (booked[i] == true)
    return true;
    return false;
    public boolean isBooked(int day) {
    return booked[day];
    public String getName() {
    return rName;
    public int getCapacity() {
    return rCapacity;
    public String getInternet() {
    if (rInternet == false)
    return NO;
    return YES;
    public String getVideo() {
    if (rVideo == false)
    return NO;
    return YES;
    public boolean matchCriterias(boolean hasInternet, boolean hasVideo) {
    if ((hasInternet == rInternet) && (hasVideo == rVideo))
    return true;
    return false;

  • Pls help (running java on linux)

    Hello freinds,,
    I am in deep need..can anyone pls help me...
    I want to run my java programs on linux server.. Below are the steps I went thru to install jdk
    *** Download and copy j2sdk-1_3_1_10-linux-i586.rpm.bin to /usr/local/src.
    % su -
    # cd /usr/local/src
    # chmod +x j2sdk-1_3_1_10-linux-i586.rpm.bin
    # ./j2sdk-1_3_1_10-linux-i586.rpm.bin
    # rpm -ivh j2sdk-1_3_1_10-linux-i586.rpm
    Now test Java:
    # /usr/java/jdk1.3.1_10/bin/java -version
    Set the PATH environent variable.
    PATH="$PATH:/usr/java/jdk1.3.1_10/bin:."
    export PATH
    I went thru all above commands uninterruptedly.. Then I copied the folder containing programs in jdk1.3.1_10/bin folder
    Now when I am trying to complile or run an existing class it's gving following error message :
    java: command not found
    OR
    javac: command not found
    Can any one pls tell me where I am going wrong???
    Thanks in advance..

    From your query i understand you've installed java at "/usr/java/jdk1.3.1_10" location on your Linux box. I've a couple of queries -
    when u try to run "/usr/java/jdk1.3.1_10/bin/java -version" what do u see. Do u see the Java version information displayed on your screen ?
    and when you try export -ing the PATH variable with the following location added "/usr/java/jdk1.3.1_10/bin" and in the same shell type "which java" what do you see ? You should be seeing "/usr/java/jdk1.3.1_10/bin/java"
    If the above works then make changes to your profile file in order to ensure changes are saved for subsequent sessions.

  • "Exception in thread "main" java.lang.NumberFormatException"error..pls help

    Hi,
    I'm trying to run a program I've written but keeping getting this error:
    Exception in thread "main" java.lang.NumberFormatException: empty String
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
    at java.lang.Double.parseDouble(Double.java:482)
    at data.newLineToRead(data.java:21)
    at data.data(data.java:34)
    at train.main(train.java:86)
    I'm not quite sure where I'm going wrong.I've included the data class and train class.Could someone pls help me.
    Thanks a lot.
    Data Class:
    import java.io.*;
    import java.util.*;
    public class data{
            private static parameter par;
            private static double[][] x=new double[par.n()][par.D()];
            public static double[] t=new double[par.n()];
            public static void newLineToRead(String LineToRead,int n){
            int d=0;
            String stringToRead=new String();
                    for(int i=0;i<=LineToRead.length();i++){
                            StringTokenizer str = new StringTokenizer (stringToRead,"/t");
                            String[] strtemp = new String[str.countTokens()];
                                    while (str.hasMoreTokens()){
                                    x[n][d++] = Double.parseDouble(str.nextToken());
                                    d++;
                                    System.out.println(x[n][d++]);
                            stringToRead=new String();
                    t[n]=Double.parseDouble(stringToRead);
                    x[n][par.d()]=1.0;
            public static void data() throws IOException{
            DataInputStream in=null;
                    try{
                            in=new DataInputStream(new FileInputStream(par.f()));
                            for(int n=0;n<par.n();n++){
                            String LineToRead=in.readLine();
                                    if(LineToRead.length()==0){
                                            System.out.println("Remove empty lines");
                                    else{
                                            newLineToRead(LineToRead,n);
                    }finally{if(in!=null){in.close();}}
            public static double x(int n,int d){return x[n][d];}
            public static double t(int n){return t[n];}
    }Train Class
    import java.io.*;
    import java.util.*;
    public class train{
             private static parameter       par;
             private static data            dat;
             private static model           mod;
             private static response        resp;
             private static void error(String msg){
                    System.out.println(msg);
                    System.exit(1);
             private static void check(){
                if(par.f().length()==0)
                    error("No filename of input vectors!");
                if(par.n()==0)
                    error("No number of input vectors!");
                if(par.d()==0)
                    error("No number of input variables!");
                if(par.d()>par.D())
                    error("Dimension is larger than 100!");
              private static void usage(){
                System.out.println("Non-default parameters==========================");
                System.out.println("-f filename of input vectors");
                System.out.println("-n number of input vectors");
                System.out.println("-d number of input variables");
                System.out.println("Default parameters==========================");
                System.out.println("-R regularisation constant (must be positive and the default value is 0.0)");
                System.out.println("-S epsilon criterion for stopping a learning process (default value is 0.001)");
                System.out.println("-C maximum learning cycle (default value is 10000)");
                      public static void main(String[] argv){
                            if(argv.length==0){
                                    System.out.println("Command line is <Java [-cp path] train parameters>");
                                    usage();
                                    System.exit(1);
                            if(argv.length==1 && argv[0].equals("help")==true){
                                    usage();
                                    System.exit(1);
                            par.nin(0); par.din(0); par.Rin(0.0); par.Cin(10000); par.Sin(0.001);
    for(int i=0;i<argv.length;i++){
                                            if(argv.equals("-f")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.fin(argv[i+1]);
    i++;
    else if(argv[i].equals("-d")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.din(Integer.parseInt(argv[i+1]));
    i++;
    else if(argv[i].equals("-n")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.nin(Integer.parseInt(argv[i+1]));
    i++;
    else if(argv[i].equals("-S")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.Sin(Integer.parseInt(argv[i+1]));
    i++;
    else if(argv[i].equals("-C")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.Cin(Integer.parseInt(argv[i+1]));
    i++;
    else if(argv[i].equals("-R")==true){
    if((i+1)==argv.length)
    error("miss the para");
    par.Rin(Double.parseDouble(argv[i+1]));
    i++;
    else error("Unkown token");
    check();
    try {
    dat.data();
    }catch(IOException e) { System.err.println(e.toString()); }
    try {
    mod.model();
    }catch(IOException e) { System.err.println(e.toString()); }
    try {
    resp.record();
    }catch(IOException e){ System.err.println(e.toString()); }

    String stringToRead=new String();
                    for(int i=0;i<=LineToRead.length();i++){
                            StringTokenizer str = new StringTokenizer (stringToRead,"/t");
                            String[] strtemp = new String[str.countTokens()];
                                    while (str.hasMoreTokens()){
                                    x[n][d++] = Double.parseDouble(str.nextToken());
                                    d++;
                                    System.out.println(x[n][d++]);
                            stringToRead=new String();
                    t[n]=Double.parseDouble(stringToRead);
                    x[n][par.d()]=1.0;
            }Not sure exactly what you are trying to do above but...
    You are setting your String to an empty String with "new String()" and then parsing that empty String. Eventually, you are trying to parse a double from that empty String:
    t[n]=Double.parseDouble(stringToRead);Also, I cannot think of a reason to ever use "new String()" when you could just use:
    String myString = "";

  • QUERY CLARIFICATION RQD :  gurus, experts pls help

    Hai,
    I am facing problem in performance of the query. sample scenario i have created here pls help me to solve
    **VEH_MAIN* TABLE (MASTER TABLE)*
    CREATE TABLE VEH_MAIN
       (     VIP_MOT_IND VARCHAR2(10 BYTE),
         VIP_IND NUMBER(10,0)
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',1);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT02',5);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('M0T03',1);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',2);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT02',6);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',3);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',4);
    **VEH_ENGINE_SUB* (table for engine subclass)*
      CREATE TABLE VEH_ENG_SUB
       (     ENG_SUBCLASS VARCHAR2(50 BYTE),
         ENG_MOT_IND VARCHAR2(10 BYTE)
    Insert into VEH_ENG_SUB (ENG_SUBCLASS,ENG_MOT_IND) values ('ENGSUB001','MOT01');
    Insert into VEH_ENG_SUB (ENG_SUBCLASS,ENG_MOT_IND) values ('ENGSUB001','MOT02');
    *VEH_ENG_IND( Detail table for engine subclass)*
      CREATE TABLE VEH_ENG_IND
       (     "ENG_SUBCLASS" VARCHAR2(50 BYTE),
         "ENG_IND" VARCHAR2(10 BYTE)
    Insert into VEH_ENG_IND (ENG_SUBCLASS,ENG_IND) values ('ENGSUB001','1');
    Insert into VEH_ENG_IND (ENG_SUBCLASS,ENG_IND) values ('ENGSUB001','2');
    *VEH_AXIS( Master table for Engine Axis)*
    CREATE TABLE VEH_AXIS
       (     ENG_AXIS VARCHAR2(50 BYTE),
         AXIS_MOT_IND VARCHAR2(10 BYTE)
    Insert into VEH_AXIS (ENG_AXIS,AXIS_MOT_IND) values ('ENGAXIS001','MOT01');
    Insert into VEH_AXIS (ENG_AXIS,AXIS_MOT_IND) values ('ENGAXIS002','MOT02');
    *VEH_AXIS_IND( Details table for engine axis)*
    CREATE TABLE VEH_AXIS_IND
       (     ENG_AXIS VARCHAR2(50 BYTE),
         ENG_IND VARCHAR2(10 BYTE)
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','1');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','2');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','3');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','4');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS002','5');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS002','6');
    Condition 1
    if i select only ENGINE_SUBCLASS='ENGSUB001' then
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )output is
    MOT01     1
    MOT01     2
    Condition 2:if i select only the Engine Axis='ENGAXIS002' then the
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE  v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002';MOT02     5
    MOT02     6
    Condition 3:
    BOTH ENGINE AXIS AND ENGINE SUBCLASS
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    AND  ( v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002');Null values returned. this is correct.
    But the query PERFORMANCE fails in OR CONDITON as below
    Condition 4;
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    OR  ( v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002');output
    MOT02     5
    MOT02     5
    MOT02     5
    MOT02     5
    MOT02     6
    MOT02     6
    MOT02     6
    MOT02     6
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    This is sample example. when i implement in huge table with partition this scennario takes much time even 2 hours to run.
    i want the output must be as below if i use OR condition like condition 4
    MOT01     1
    MOT01     2
    MOT02     5
    MOT02     6
    Gurus and experts pls help me to solve this problem. Dont give any suggestion like
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE  v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002'
    union
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    }this will give correct result...
    MOT01     1
    MOT01     2
    MOT02     5
    MOT02     6
    but the problem is we cannot implement this in query. because query get framed at runtime there will be so many implement has to be done. other than UNION pls give me more suggesion
    waiting..
    S
    Edited by: A Beginner on Sep 11, 2010 12:51 AM

    create a view v1 with all the joins
    select * from v1 where eng_subclass='ENGSUB001'
    union
    select * from v1 where eng_axis='ENGAXIS002'
    If you really do not like the direct access with union, try this
    select * from v1
    where vsub_PK in (select vsub_PK from v1 where eng_subclass='ENGSUB001' )
    OR vsub_PK in (select vsub_PK from v1 where eng_axis='ENGAXIS002')
    --vsub_PK is the primary key of table vsub                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Urgent,pls help! java.lang.NullPointerException

    Dear all,
      I'm doing a web dynpro app for creating the physical inventory doc for WM ( warehse mgmt ).. I haf a input field,storage type which is the be key in by the user.
    When i testing my application,if i type in any 3 digits number tat doesn't belongs to a storage type in R/3,the application seems working fine,it will return me a error msg saying tat the stoage type that i typed in doenst exists in the R/3 system. but if i enter an excat storage type,( for example,002 ) into the intput field,i will get an error msg saying java.lang.NullPointerException . Any gurus haf any idea what is happening? pls help,many thanks.

    Hi Joan,
                   Can u send the stack trace & code line , where u r getting NPE??
    regards
    Sumit

  • Pls help me about Runtime.getRuntime().exec("java...")

    I have two applications. One is Client, the other is Platform.
    In the Platform, there are source files packaged into a library named ZtConfig.jar used by Client. If run Client and Platform, two applications can execute normally.
    But if Client is started by user from platform, there is something wrong.
    I noticed the error difficultly with finally catching exception.
    I was puzzled. It is so strange. Pls help me. I list some codes here.
    In Client where finally exception catched:
    import zt.config;
            try {
              xmlFileUrl = new java.net.URL(
                  "file:///e:/Client/src/config/nsr1000.xml");
            catch (IOException ex1) {
              FileLogger.error(ex1.getMessage());
            FileLogger.info("NSR1000Document.setIEDContent", xmlFileUrl.toString());
            try {
              xmlLoader = new XMLConfigLoader(xmlFileUrl);
            finally {
              FileLogger.error("NSR1000Document.setIEDContent",
                               "cannot new XMLConfigLoader object");
              return; // the following codes cannot execute, so have to return here.
    In the XMLConfigLoader, the constructor is
      public XMLConfigLoader(java.net.URL xmlFileUrl) {
        this.xmlFileUrl = xmlFileUrl;
        configDoc = null;
        builder = null;
        xmlDoc = null;
    Platform start Client application using the following code
      Runtime.getRuntime().exec(
                    "java -jar e:/Client/Client.jar");

    I've got it!
    Briefly, it is because classpath setting was overwritten by JBuilder.
    Firstly, I start Platform from JBuilder. In its messages window. The command is
    d:\j2sdk1.4.2_06\bin\javaw -classpath "JBPATH" zt.client.nsr1000.NSR1000App
    Now, classpath environment variable was changed to be JBPATH. While I start
    Client use Runtime.getRuntime().exec("java -jar Client.jar"), it will not run for classpath changed.
    Then, I configured all packages used by Client into JBuilder libraries, including
    Client.jar. And changed codes Runtime.getRuntime().exec("java -jar Client.jar") to be Runtime.getRuntime().exec("java -Xmx128m zt.client.nsr1000.NSR1000App")
    I also changed CLASSPATH windows system environment variable.
    I found this from command console, it can display exceptions. But from JBuilder, there is no exception that can be captured. So debug is difficult.

  • Pls help me about two java virtual machine

    have two applications. One is Client, the other is Platform.
    In the Platform, there are source files packaged into a library named ZtConfig.jar used by Client. If run Client and Platform, two applications can execute normally.
    But if Client is started by user from platform, there is something wrong.
    I noticed the error difficultly with finally catching exception.
    I was puzzled. It is so strange. Pls help me. I list some codes here.
    In Client where finally exception catched:
    import zt.config;
            try {
              xmlFileUrl = new java.net.URL(
                  "file:///e:/Client/src/config/nsr1000.xml");
            catch (IOException ex1) {
              FileLogger.error(ex1.getMessage());
            FileLogger.info("NSR1000Document.setIEDContent", xmlFileUrl.toString());
            try {
              xmlLoader = new XMLConfigLoader(xmlFileUrl);
            finally {
              FileLogger.error("NSR1000Document.setIEDContent",
                               "cannot new XMLConfigLoader object");
              return; // the following codes cannot execute, so have to return here.
            }In the XMLConfigLoader, the constructor is
      public XMLConfigLoader(java.net.URL xmlFileUrl) {
        this.xmlFileUrl = xmlFileUrl;
        configDoc = null;
        builder = null;
        xmlDoc = null;
      }Platform start Client application using the following code
      Runtime.getRuntime().exec(
                    "java -jar e:/Client/Client.jar");

    I've got it!
    Briefly, it is because classpath setting was overwritten by JBuilder.
    Firstly, I start Platform from JBuilder. In its messages window. The command is
    d:\j2sdk1.4.2_06\bin\javaw -classpath "JBPATH" zt.client.nsr1000.NSR1000App
    Now, classpath environment variable was changed to be JBPATH. While I start
    Client use Runtime.getRuntime().exec("java -jar Client.jar"), it will not run for classpath changed.
    Then, I configured all packages used by Client into JBuilder libraries, including
    Client.jar. And changed codes Runtime.getRuntime().exec("java -jar Client.jar") to be Runtime.getRuntime().exec("java -Xmx128m zt.client.nsr1000.NSR1000App")
    I also changed CLASSPATH windows system environment variable.
    I found this from command console, it can display exceptions. But from JBuilder, there is no exception that can be captured. So debug is difficult.

  • Pls help.. java engine is not working

    Dear All
    when i type SXMB_IFR, i am getting error as below.. pls help how to enable the java engine.. to get into XI Java Stack.
    Error
    500   Internal Server Error
    Exception
    An internal error occurred. Contact you XI administrator
    java.lang.NoClassDefFoundError
    Error Details, Error History, Build Info, Generic Application Info

    Hi,
    You can also check if  the address and logon data of the Integration Builder is correctly maintained in the
    Exchange Profile (http://<IntegrationServer>:<port>/exchangeProfile/index.html
    also check if Tcode SLDCHECK works fine.If its a new installation please check if all the post installation steps
    are performed correctly.
    Regards,
    Srinivas

  • Pls Help:Running a C executable from my Java Code

    I am trying to run a C/C++ executable a.out from my Java code but its not working pls help me out...Its very very important
    I am writing a segment of the code pls point out if i am making any mistakes
             public void itemStateChanged(ItemEvent a)
              int i=c1.getSelectedIndex();
              Runtime r=Runtime.getRuntime();
              try
                   if(i==0);               
                   if(i==1);
                   if(i==2);     
                   if(i==3)
                        r.exec("./prog/a.out");               
                        System.exit(0);
              }catch(Exception e){}
         }I am working in UNIX enviornment

    Before any other attempt read: [url http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html]When Runtime.exec() won't.

  • Hi experts pls help me with this materialized view refresh time!!!

    Hi Expeerts ,
    Please clarify my doubt about this materialized view code
    [\n]
    CREATE MATERIALIZED VIEW SCHEMANAME.products_mv
    REFRESH WITH ROWID
    AS SELECT * from VIEW_TABLE@DATAOPPB;
    [n]
    Here i am creating a materialized view named products_mv of the view_table present in the remote server.Can anyone tell me when will my table product_mv will get refreshed if i follow this code.As what i read from the books is that the refresh period is implicit and is carried out by the database implicitly.so can u tell me suppose i insert 2 new records into my view_table when will this record get updated into my product_mv table.
    I cant use primary key approach so this is the approach i am following .Kindly help me in understanding when will refresh of records occur in the materialized view product_mv...Pls help
    regards
    debashis

    Hi Justin ,
    Yes, my database can reasonably schedule other jobs too .Its not an issue.
    Actually what i meant "fine in all aspects" is that will the matrerialized view will get refreshed w.r.t the documetum_v table present in my remote server.This is all i need to refresh my materialized view .
    I queries the DBA_JOBS table .I could see the following result i have pasted below:-
    [\n]
    NLS_ENV
    MISC_ENV INSTANCE
    dbms_refresh.refresh('"WORKFLOW"."PRODUCTS_MV2"');
    JOB LOG_USER PRIV_USER
    SCHEMA_USER LAST_DATE LAST_SEC THIS_DATE THIS_SEC NEXT_DATE
    NEXT_SEC TOTAL_TIME B
    INTERVAL
    FAILURES
    WHAT
    [n]
    here WORKFLOW"."PRODUCTS_MV2 is the materialized view i have created.So can u tell me that whether we can predict our refresh part is functioning fine from this data.If so how?
    Actually i am asking u in details as i dont have much exposure to materialized view .I am using it for the very first time.
    Regds
    debashis

Maybe you are looking for

  • HT4436 Can I have more than one iCloud email address with the same Apple ID?

    I created an iCloud email account and I was wondering if I could make another one with a different [email protected] using the same Apple ID. Can anyone help me? - Alex

  • Adobe X Pro does not play well with Firefox 12.0

    Using Firefox 12.0 and up to date version of Acrobat X Pro -- no Adobe toolbar but listed in plugins. Work around using print Adobe Pdf consistently hangs or crashes.

  • Status bar text is not read by Screen reader.

    Dear Colleagues, In my Java application(Java Swings), I use a status bar to show the status of application for user. In String XML file, I use the status message type as 'XMSG'. This perticular text is not read by the SCREEN READER. This is tested du

  • EvHOT in EvDRE

    How can I use Evhot in EVDRE function? Can I put this command in the key description column? If yes, how do I get both the description and evhot functionality to show up? Thanks...

  • Doc. Header Text (BKTXT) in MB1C

    Hello Experts, Requirement is to copy 501 mvt type into a new mvt type & for the new one, the field Doc. Header Text (BKTXT) should be made mandatory in MB1C t-code. 1)Whether any configuration available to achieve the same? 2)If it can be done throu