A small prob...

Hi,
i am akila.i have a small problem with my program. i will copy both my program and error... If anybody can make it out... plz reply...
this is the program
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@SuppressWarnings("serial")
public class Events extends JPanel implements ActionListener
     final static String newline="\n";
     JLabel l;
     JTextArea a;
     JButton b;
     Events()
          l = new JLabel("Just checkin");
          add(l,BorderLayout.BEFORE_FIRST_LINE);
          b = new JButton("This is it!!!");
          add(b,BorderLayout.AFTER_LINE_ENDS);
          b.addActionListener(this);
          a = new JTextArea(5,20);
          a.setEditable(true);
          add(a,BorderLayout.CENTER);
          JScrollPane scrollPane = new JScrollPane(a);
          add(scrollPane, a);
     public void actionPerformed(ActionEvent e)
          String s=e.getActionCommand();
          System.out.println(s);
          a.append(s+newline);
          a.setCaretPosition(a.getDocument().getLength());
     public static void Create()
          JFrame frame = new JFrame("Event handler trial");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JComponent newContentPane = new Events();
          JMenuBar j = new JMenuBar();
          j.setPreferredSize(new Dimension(200,20));
          j.setBackground(new Color(100,100,100));
          j.setOpaque(true);
          frame.setJMenuBar(j);
          newContentPane.setOpaque(true); //content panes must be opaque
          frame.setContentPane(newContentPane);
          frame.pack();
          frame.setVisible(true);
     public static void main(String[] args)
          javax.swing.SwingUtilities.invokeLater(new Runnable()
               public void run()
                    Create();
This is the error...
This is it!!!
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     at Events.actionPerformed(Events.java:41)
     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.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.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)

Hi akila. Your code compiles and runs fine when I tried it.
Which is line 41? (The stack trace is saying that something on that line is null.) The line "a.setCaretPosition(a.getDocument().getLength());" looks OK.

Similar Messages

  • Many small probs with my K8N Neo

    Specs:
    K8N Neo Platinum w/ newest version of BIOS (I checked)
    1 GB PC3200 Kingston RAM (2x512MB)
    ATI brand Radeon 9700 pro 128MB
    60.0GB Maxtor 5400RPM HD
    500w Viomax PSU (30A on +3.3V, 50A on +5V, 25A on 12V)
    No other PCI cards installed at the moment
    Problems:
    1. My computer won't restart. Whenever Windows calls for a restart or I hit the button myself, the screen goes blank while everything else stays active. People here told me it was my PSU. My Radeon 9700 Pro requires an extra floppy power cable so I thought I'd test out another video card that didn't need extra power to see what would happen. My comp worked fine with a 9200. So I bought a 500w Viomax PSU, a cheap one, yes, but it got good reviews. I stuck it in there and my comp STILL wouldn't restart normally. It has changed however: it'll restart the 3rd or 4th time I hit the button, but never the first..... which it definitely should.
    2. My HD wasn't recognized by my mobo. After doing the first part of installing WinXP pro, my computer restarted (well, I had to switch the PSU off then on again to get it to work) but then I got "Error loading operating system." After a while of trial and error I arbitrarily changed the "Access Mode" in CMOS to "Large" instead of "Auto". Bingo, it worked, yay. Even though it works now, I still don't like the idea that my mobo couldn't automatically recognize my HD. I tested different ribbon cables and other HDs that I knew worked fine in other computers but they all wouldn't work in mine unless I put the setting on Large. hmmm.
    3. The supplied nVidia IDE driver slows down my computer and causes Video Errors. The windows logo takes FOREVER to show up (or it will freeze in the middle of its fading it for 10-15s) when those IDE drivers are installed. As soon as I uninstall them everythings chipper though. Note that this problem is IDE, which might go along with why my HD isn't recognized.
    4. When I open GoodMem, a memory manager/monitor that came with the mobo, my computer drastically slows down to a point where it's literally not usable. If I close GoodMem, it goes back to normal. I tried out a 256MB stick of my sisters just to see what happens and what'da ya know, GoodMem works perfectly.
    I've never built a computer before and all this really makes me wanna RMA my board....... so here's the big question.... SHOULD I?
    Thanks everyone,
    -Robert Lee

    Hi
    sounds more like a Disk prob, or Windows prob than Mobo or CPU,
    Did you format the HDD on this comp, if it was formatted on another machine, it can cause it not to be recognised.
    Virus or Spy progs can slow down a comp,  Try Task Manager, Ctrl +Alt + del, see what procs are running, if there is a strange unknown one it may be cause. If you go to the processor heading, the proc idling should not be using much CPU time, if something is using a lot of CPU time and is not essential, close it and see if it helps.
    For the HDD, try disk management. Right click My computer, then manage then disk management, you will see if disk are healthy, you can also check them for probs.
    May need defraged, and Chkdsk run.
    In device Manager, does the IDE HDD show as OK, no yellow marks. You could try updating driver,
    cheers
    jocko

  • Small prob in ignoring string want to skip 2nd value?

    Hi all,
    here CONSTRAINT Adept_Usr_Login NOT NULL ,
    i have three fixed but 2nd is dynamic how to do this here.
    if( tokens0.equalsIgnoreCase( "CONSTRAINT" ) && tokens2.equalsIgnoreCase( "NOT" ) &&
    tokens3.equalsIgnoreCase( "NULL" ) )
    // dataLines.append( " -- " );
    dataLines.append( "NOT " ).append("NULL ").append(" , ").append(" -- ");
    dataLines.append( dataLine ).append( '\n' );
    Can any one give proper suggestion what to de here.
    thanks
    Vijendra

    i don't know whether i will be properly displayable or not.
    import java.util.Enumeration;
    import java.io.*;
    import java.util.StringTokenizer;
    import java.sql.*;
    public class FileReading{
    public static void main(String args[]){
    String file="C:/Documents and Settings/vijendras/Desktop/sampleApplicationchngd.sql";
    //modified by vijendra for ignoring views and stored procedures on 11 Apr 2006
    try {
    // open the file for reading
    FileReader inputstream = new FileReader (file);
    BufferedReader rdr = new BufferedReader( inputstream );
    // the StringBuilder which stores the processed lines
    StringBuffer dataLines = new StringBuffer();
    // read the file line by line
    String dataLine;
    boolean pending=false;
    while((dataLine = rdr.readLine()) != null ) {
    // split the input data into words upto first 3 words only
    //String[] tokens = dataLine.split( " ", 3 );
    String[] tokens = dataLine.trim().split( " ", 3 );
    StringTokenizer st = new StringTokenizer(dataLine.trim()," ");
                        String tokens0 = "";
                        String tokens1 = "";
    if(st.hasMoreTokens()){
                             tokens0 = st.nextToken();
                        if(st.hasMoreTokens()){
                             tokens1 = st.nextToken();
    if (!pending) {
    // if the line starts with 'create' and a 'view' follows it,
    // then add a "--" to the beginning of the line
    if((tokens0.equalsIgnoreCase( "create" ) && tokens1.equalsIgnoreCase( "view" ) )||
    (tokens0.equalsIgnoreCase( "create" ) && tokens1.equalsIgnoreCase( "procedure" ))
                             //state #2
                             // dataLines.append( "-- " );
                             // dataLines.append( dataLine ).append( '\n' );
                             pending = true;
                   // added by vijendra for modifying CONSTRAINT NAME NOT NULL to NOT NULL on 30 June 2006
                        //System.out.println(tokens[ 0 ].trim()+"::::"+tokens[ 1 ].trim()+"::::"+tokens[ 2 ].trim());
    if( tokens[ 0 ].trim().equalsIgnoreCase( "CONSTRAINT") && tokens[ 2 ].trim().equalsIgnoreCase( "NOT NULL," ) ){
    dataLines.append( " NOT " ).append(" NULL ").append(" , ").append(" -- ");
    dataLines.append( dataLine ).append( '\n' );
              System.out.println( "Executed");
                             else {
                             //state #1
                             // you're not in a[nother] view/proc yet}
                                  //dataLines.append( "-- " );
                                  dataLines.append( dataLine ).append( '\n' );
                   if (pending) { // don't use 'else'
                        //line contains ';'
                   if (!dataLine.endsWith(";")) {
                                  //state #4
                                  // do whatever... you're finished
                             dataLines.append( "-- " );
                             dataLines.append( dataLine ).append( '\n' );
                                  else {
                             //     state #3
                                  //you're in continuation of view/proc
                                  //but haven't found end yet
                                  dataLines.append( "-- " );
                                  dataLines.append( dataLine ).append( '\n' );
                             pending = false;
         /*Note the 'if' I marked "don't use else" which allows the logic to fall through and catch both
         states #2 and #4 (start and end) on the same line.*/
    rdr.close(); // close the file
    inputstream.close();
    // open the file for writing new data to it
    FileWriter outputstream=new FileWriter( file );
    BufferedWriter writer = new BufferedWriter(outputstream);
    // write the new StringBuilder's data back to the file.
    writer.write( dataLines.toString(), 0, dataLines.length() );
    writer.close(); // close the file
    outputstream.close();
    } catch( IOException e ) {
    System.out.println("Exception"+e);
    out put of sql file is now this but it sholud be applied to all.
    CREATE TABLE Adept_User(
    Id NUMBER(10, 0)     NOT NULL,
    Login_Name VARCHAR2(30)
    NOT NULL , -- CONSTRAINT Adept_Usr_Login NOT NULL,
    First_Name VARCHAR2(35)
         CONSTRAINT Adept_Usr_First_name     NOT NULL,
    Last_Name VARCHAR2(35),
    User_Password VARCHAR2(10)
         CONSTRAINT Adept_Usr_Last_name     NOT NULL,
    User_Status NUMBER(10, 0)
         CONSTRAINT Adept_Usr_Status     NOT NULL,
    User_Type NUMBER(10, 0)
         CONSTRAINT Adept_Usr_Type     NOT NULL,
    Customer_Contact NUMBER(10, 0),
    Employee NUMBER(10, 0),
    Organization Number(10,0),
    Password_Modified_Date DATE,
    Currency_Master_Id NUMBER(10, 0),
    CONSTRAINT PK23 PRIMARY KEY (Id)
    CREATE TABLE Adept_User_Group(
    Id NUMBER(10, 0) NOT NULL,
    Adept_Group NUMBER(10, 0)
         CONSTRAINT Adept_Usr_Grp     NOT NULL,
    Adept_User_Name NUMBER(10, 0)
         CONSTRAINT Adept_Usr_name     NOT NULL,
    CONSTRAINT PK157 PRIMARY KEY (Id)
    CREATE TABLE Adept_User_Permission(
    Id NUMBER(10, 0)     NOT NULL,
    Adept_Screens NUMBER(10, 0)
         CONSTRAINT Adept_Usr_Perm_Scren     NOT NULL,
    Adept_User_Group NUMBER(10, 0)
         CONSTRAINT Adept_Usr_Grp     NOT NULL,
    Dashboard char(1),
    CONSTRAINT PK28 PRIMARY KEY (Id)
    sorry for inconvinience for reading this all.
    if there is some better way to show all plese tell me.
    Vjendra

  • HFR Urgent Queris :  Small thing...but not working...........

    Hi All,
    I'm facing small prob. but i became big one.
    Prob. 1) : in column A i have year dim with prompt.
    in column b i need previous year of col A.
    For this , in col b i used relative function with same as col a - 1.
    but its not working.
    Prob 2) : I have 2 grids. in col a,b i pull the data from same grid and col c,d i need to create a formula var of grid2
    col a,b.
    For this, i used the formula like this var(grid1.col[a],grid2.col[a]).but when i run the report it shows #error. Any idea.
    Plz give me any solution for these probs......
    Thanks

    For Prob 1: Instead of using prompt for year, you can use POV selection for year, so remove the prompt, and make it current user POV for year for column A. For column B make it Relative member of Current POV for year with offset -1.
    or you can put prompts on both column A and column B,, so the user will have to select two years manually, and this gives the user the chance of using any year he wants for column B instead of using always selected year -1.
    For Prob 2: Since you want to calculate var of the 2 columns of 2 different grids, I am assuming that the rows of the both grids are exactly same. So, If you can add another column to Grid1 and make it same with column A of grid 2, then use it with your calculation. If you want you can hide it.
    hope this helps
    Bulent

  • APPLE customer service for ipod touch

    sorry if this is a bit dragged out post, but i'll limit it to as short as possible.
    bought my daughter an ipod touch for last christmas which has always been inside a hard case and never been outside and is like new when out of case(for cleaning).
    last month or so it developed a small prob with sound not playing on some tracks(posted in here also), i sent it back to apple for repair, they sent it back saying it was software issue and they updated software accordingly, within days of recieving it back it started to develop another problem with the screen flickering on and off and the totally stopped responding to touch,called apple again to inform them of this and they asked for it back,sent it back again(only using their package service & UPS courier) i recieved it back a few days later with a very crude note stating they will not be repairing it because it has been subject to abuse/neglect in the form of liquid damage. no explaination as to what has been damaged or even cost of repair. i know for a fact 100% this has not been near water or any liquid, i have asked apple for an explaination and sent them 3 letters of complaint which they do not answer,i have now contacted consumer direct uk, they are advising small claims action.
    anyone have similar problem or any advice they can offer? looking on consumeraffairs.com this seems to be a regular tactic of apple

    If the water sensor has been triggered, Apple will refuse warranty service. You state that the iPod has never been exposed to moisture. I'm not saying that you would not tell the truth, but many people claim that a unit hasn't been abused only to find/admit later that it has, so your protestations will probably be in vain. Apple will point to the sensor being triggered as hard evidence that it has indeed come in contact with moisture. Heck, unless you've had the unit in your possession 24/7 since you got it, you can't even with certainty say that it hasn't; many children have, for instance, inadvertently and sometimes unknowingly had a spill in a backpack that damaged some electronic device.
    As others have suggested, you can try taking the unit to an Apple Store and discussing the issue. You can also call the Apple tech support line and asking to speak with a customer service representative. But I would guess that neither route will be of any use; Apple sees the moisture sensor triggered and that ends the matter for them.
    You can see your options for out-of-warranty service from Apple here:
    http://www.apple.com/uk/support/ipod/service/faq/#warranty6
    They have flat repair prices for iPods which you can see here:
    http://www.apple.com/support/ipod/service/prices/#uk
    Alternatively, you can pursue repair though third-party service providers. Whether or not those would be more cost-effective I can't say.
    Message was edited by: Dave Sawyer

  • Curve 9360 custom sound alerts for messages will not work. Tried EVERYTHING.

    I have a brand spanking new BlackBerry Curve 9360 that just arrived yesterday.  It is great apart from this very frustrating small prob.  I can not customise my message alerts for individual people in my address book.  When I click on "try it" only the LED button flashes and there is no sound or vibration.  I am trying to get the sound and vibrate to play as "active profile" but it just won't.  I can override it and have custom volume and vibrate that plays no matter what the profile but as I sometimes like to set my main profile to vibrate or silent, it won't do.
    So far, to fix it, I have tried:
    Wiping profile and sounds from the blackberry software
    Full factory reset
    Creating my own profile and using that instead of "normal" or any of the other preset ones
    Loads of battery pulls before and/or after any changes
    I have also had a few different people text me to make sure the problem isn't just the "try it" feature.  It isn't.  The sound that plays is always the default message sound for whatever the default profile is.
    If anyone can help it would be greatly appreciated
    Deb

    I have also experienced exactly the same problem.
    The profile is set on normal, with the ringer volume on 10, the ring tone has been selected, and I have also selected the option of the vibrator along with the ring tone.
    Now here is the problem, initially it rings and works perfectly, however it seems to automatically turn off the volume so the LED light keeps flashing, however there is not ring tone or vibration.
    If you select the "normal" profile or any other profile and change the ring tone or the volume, and click on the try it icon at the bottom, it still only flashes the LED, with no sound.
    Have tried everything that you have mentioned in your email, however still unable to rectify the issue. the only way to rectify is it to hard stop the BB, by pulling out the battery and restarting the Blackberry.
    Can anyone help or suggest what needs to be done ?

  • SD Card in CD Port

    I have put an SD card into my CD Port.  Is there any remedy short of sending the iMac into Apple?  I can't reach it with a small probe.

    Have a look at this short video - looks easy with a bit of card:
    http://www.youtube.com/watch?v=hpwDfpH4hR0
    Best to turn the Mac off while you do it

  • Multiple reads from DataInputStream through Socket

    Ok I got a small prob, and well, here it is:
    I have a server and a client.
    The client needs to send a file to the server.
    I'm using Data(Input/Output)Stream.
    I use writeLong() and readLong(), to send the size and after that read the size of the file.
    And after that I send the file.
    But the file is always corrupted, but if I leave the size sending part out and enter the size hardcoded it works fine!
    Here's a small snippet from the server-code.
    // Read the filesize.
    long fileSize = in.readLong();
    // Receive and save the file.
    int bytesRead = 0;
    int bytesToRead = 1024;
    byte[] input = new byte[bytesToRead];
    while(bytesRead < fileSize) {
         int result = in.read(input,0,bytesToRead);
         if(result == -1) break;                              
         bytesRead += result;
         out.write(input,0,bytesToRead);
         System.out.println(bytesRead + "/" + fileSize);
    in.close();
    out.flush();
    out.close();Any help is very appriciated...
    Thnkx in advance...
    Robert.

    I'm assuming out is a file. I think you are writing too much. You want to write what was read in, not the full array. The default values of the byte array bytes is 0 (or since not being reset, the last value read). So say you read in a lot of bytes in one read call, then a few in the 2nd, and then more in the 3rd, you are writing some old data (from 1st read) in the 2nd write, which will corrupt the file. Somehow I doubt that it's always the case that withouth the readLong part that it doesn't work. Just a fluke thing that happens any particular time.
    // Read the filesize.
    long fileSize = in.readLong();
    // Receive and save the file.
    long bytesRead = 0;
    int bytesToRead = 1024;
    byte[] input = new byte[bytesToRead];
    while(bytesRead < fileSize) {
         int result = in.read(input,0,bytesToRead);
         if(result == -1) break;                              
         bytesRead += result;
         out.write(input,0,result);
         System.out.println(bytesRead + "/" + fileSize);
    in.close();
    out.flush();
    out.close();

  • Calling procedures multiple times passing rum time parameters

    hii,
    i ve this small prob with my procedure..my proc is
    CREATE or replace PROCEDURE sad(star_val number,dept_id number) IS
    BEGIN
    update dept set star=star_val where department_id=dept_id;
    END;
    and i call this proc using a loop and give the values at runtime..
    declare
    v_count number(3);
    begin
    v_count := 4;
    loop
    sad(&value,&dept);
    v_count := v_count-1;
    exit when v_count=0;
    end loop;
    end;
    this procedure runs only once with out looping 3 times..can anybody help me out..

    .... passing rum time parameters ......
    programming in the caribbeans must be wonderful
    anyway : how do you know it ran only once ?
    most probably it ran 5 times doing the same update defined by &value,&dept
    ahh, now I get it, you believe you'll be asked again and again to enter values for &value,&dept .
    Sorry, no can do, PLSQL is not interactive
    further reading at http://tahiti.oracle.com

  • Using same line in Console/Screen System.out.println()

    Ok next small prob, and then thats it lol,
    Let's say if I want to print something out to the screen...
    And after that print something again on the same line...
    So, sorta like refreshing the line.
    I can't figure it out because System.out.prinln() jumps to the next line.
    Thnkx in advance
    Robert

    public class Switch
        public static void main(String args[])
            try {
                for(;;){
                    System.out.print("Hello   ");
                    System.out.flush();
                    Thread.sleep(2000L);
                    System.out.print("\u0008\u0008\u0008\u0008\u0008\u0008\u0008\u0008");
                    System.out.print("Good Bye");
                    System.out.flush();
                    Thread.sleep(2000L);
                    System.out.print("\u0008\u0008\u0008\u0008\u0008\u0008\u0008\u0008");
            catch(Exception ex) {
                ex.printStackTrace();
    }

  • Character encoding in internationalization

    hiya everyone,
    gotta small prob... i save a chinese resource bundle file using word as unicode file.. when i invoke the resource bundle and try to get the value for the key... do i need to create a streamreader and specify the encoding? the normal way of just getting the value as string doesn't work in this case...
    any clues????
    Thanx
    xxx

    Also, don't forget the native2ascii.exe utility, you can use that in conjunction with a normal text editot to convert native encoded (eg SHIFT-JIS) text to the latin strings represents by unicode escapes. A good explanation is in another post:
    http://forum.java.sun.com/thread.jsp?forum=16&thread=525427&tstart=0&trange=15
    About the only thing this doesn't mention is that native2ascii writes to the standard output. Anytime I tried to use it to over-write the same file I just ended up with a 0 byte file. ie:
    native2ascii file.properties > file.properties
    doesn't seem to work (under windows anyway). You need to use an intermediate file it seems.
    Regards
    Iain

  • Need to create users and default passwords in su10

    Hi Experts,
    I have a small prob generating the passwords for the MASS users creation in Su10.How could we generate the same password for all the users in the Mass creation.Is there any process to set the default passowrds for ll users.
    Regards,
    Surya.

    Hi
    Use SCATT script for this, better than SU10
    For more help
    http://209.85.175.104/search?q=cache:MMJJi_P39VUJ:www.dop.wa.gov/NR/rdonlyres/04284671-03DB-472B-A406-E52D7155C3FB/0/SSO_Decentralized_Security_Handbook_v3e.docSAPgeneratepasswordsformassusersusingsu10&hl=en&ct=clnk&cd=11&gl=in
    Regards
    Bhaskar
    Edited by: bhaskar1818 on Jul 26, 2008 10:21 AM

  • Error while connecting to SQL Server

    hello guys ,I am getting a small probs when Itry to connect Sql Server.
    after code is complied, firstly,it can run,but secondly it can't run
    error is:
    Exception in thread "main" java.lang.nullPointerException

    my code is:
    import java.sql.*;
    public class ConnectionBean
    private Connection connection;
    private Statement statement;
    private static final String      
    drive="com.microsoft.jdbc.sqlserver.SQLServerDriver";
    private static final String dbURL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=java";
    private static final String login="sa";
    private static final String password="";
    public ConnectionBean()
    try
         Class.forName(drive);
         connection = DriverManager.getConnection(dbURL,login,password);
         statement = connection.createStatement();
    catch (ClassNotFoundException e)
    System.err.println("ConnectionBean: driver unavailable");
    connection = null;
    catch (SQLException e) {}
    public ResultSet executeQuery(String sql) throws SQLException
         return statement.executeQuery(sql);
    protected void finalize()
    try
    connection.close();
    catch (SQLException e) { }
    public static void main(String[] args)
         ConnectionBean bean = new ConnectionBean();
         String sql = "select * from Conferences";
         try
              ResultSet rs= bean.executeQuery(sql);
              while ( rs.next())
                   System.out.println(rs.getString("ID"));
                   System.out.println(rs.getString("city"));
                   System.out.println(rs.getString("airport"));
                   System.out.println(rs.getString("seats"));
         catch (SQLException e)
         finally
         bean.finalize();     
    }

  • Batch Not Maintained error

    Hi,
    This sounds to be a small prob, but i hv got totally confused over it.
    When I am trying to make a Stock Purchase Order (ME21N) from one plant to other, after entering the details, the error message is coming "Batch not maintained".
    I have checked up the data (maynot be right) where I can see the batch is maintained for the said plant.
    I think some values needs to be updated or checked for it to work.
    Please provide help to me.
    Thanks,

    Hi
    Check Tcode MBC1 for MM
    Check Tcoce VCH1  for SD and select the selection criteria.
    Irfan
    Edited by: Mohammad Irfan on Nov 12, 2008 10:56 AM

  • Deleted zero

    Hi all,
    i have small prob.... how i want to delete zero in string format... let say i have 123000 and i want to get output 123 or i have 1200000 so i want to be 12...
    can someone help me...
    Thanks...

    Hi,
    u can do it in number of ways.
    Use TCODE SU3
    Select default tab and select radio button 123467.89 in decimal notation and save it.
    or u can try :
    if you want to do this through ABAP program.
    1. to delete trailing spaces.
    SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
    to delete leading zeroes,
    SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
    only for one abap program, u can use set country command
    for all programs :
    sap menu>system->go to user profil->own data>default --> and choose ur format.
    or u can use these fms also..
    CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
    CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
    reward if it helps..
    Regards,
    Omkar.

Maybe you are looking for

  • My imessage is no longer working along with sms

    My friend and i both have iphones and imessage all the time. There is the occasional moment when we send sms because imessage is not avalible. I started getting the messages from his email. I added his email to his contact. His messagess began coming

  • No sound from DVD

    I am not getting any sound from playing DVDs. Cds and all system sounds are OK. iMac running Leopard. Please help

  • New Funtional Req-MRP Wizard Option Would Allow For Planning by Warehouse

    The MRP Wizard should only generate recommendations for the warehouse(s) selected. This would allow proper planning by warehouse. My client runs multiple warehouses in single database and manages stock levels by those warehouses. The primary reason f

  • MDX query to get negative measures

    I need to query a cube with all negative values, unfortunately I'm new to MDX and find the syntax very alien compared to SQL. I want to get the sum of all negative values from the database. SQL would be: SELECT Desk,Rating_Group, SUM(Value) FROM fact

  • Officejet 6000 Flashing lights & locked carriage..​.

    My officejet 6000 just turned two last week - most has been fine until I sent a print to the printer and when it woke up all the lights on the front just flash continuely. I open the top and the carriage will not move - it feels like it is locked int