CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Bnt

Page 1 of 28 1 2 3 4

Search: Search took 0.13 seconds.

  1. Re: Difference between request.getParameter() and request.getAttribute()

    Hi,

    Firstly, please could you start a new thread for a new question.

    Secondly, please post more code, it's hard to see what code is unreachable whith only those 2 lines of code.
  2. Thread: string comparison?

    by Bnt
    Replies
    2
    Views
    805

    Re: string comparison?

    Hi

    For comparing Strings you need to use the equals() method ie:


    String a = "123";
    String b = "123";

    if(a.equals(b)){
  3. Replies
    1
    Views
    1,375

    Re: Getting Session Attributes in a servlet.

    Hi,

    To get the session:


    // Will return the currreent session, if 1 doesn't exists will return null
    request.getSession(false);
    // OR
    // Will return the currreent session, if 1 doesn't...
  4. Replies
    2
    Views
    878

    Re: Add a double to a Vector?

    Hi,

    If you are using JDK 5 or above there is an easier way of doing. The way that smbelow suggested works fine except that you will need to cast the object you get out of the Vector to a Double...
  5. Thread: Need Button advice

    by Bnt
    Replies
    22
    Views
    2,271

    Re: Need Button advice

    Thats because you are comparing the title of the dvd to itself:


    if(dvd.title.equalsIgnoreCase(dvd.title))

    which will always return true since you are comparing the title of the same dvd. Then...
  6. Replies
    8
    Views
    1,600

    Re: NullPointerException at doGet line 63

    It is possible then that your Connection object is null, do you get any errors when creating the connection? On the line 63 where you call connection.createStatement, that is where the NullPointer...
  7. Thread: Need Button advice

    by Bnt
    Replies
    22
    Views
    2,271

    Re: Need Button advice

    Well firstly you need to decide how you are going to save it to a file, are you going to serialize the objects directly to the file or are you going to take the approach of writing the text out to a...
  8. Replies
    2
    Views
    1,746

    Re: button and text area padding

    Hi,

    How are you dividing the panel into a grid exactly?
  9. Thread: Need Button advice

    by Bnt
    Replies
    22
    Views
    2,271

    Re: Need Button advice

    Hi,

    Firstly without all your code it is hard to help, I don't know what type the variable dvds is? You say it is an array but it looks more like a List of some type. If you want to just get the...
  10. Replies
    8
    Views
    1,600

    Re: NullPointerException at doGet line 63

    Hi,

    When using request.getParamtere() you should always check for null, ie:



    String sqlStatement = request.getParameter("sqlStatement");
    if(sqlStatement == null){
    // Handle this
    }
  11. Thread: New to Java

    by Bnt
    Replies
    3
    Views
    864

    Re: New to Java

    Hi,

    You can get a free download of the Java tutorial from sun, get it HERE . Surfing the internet will also provide you with lots of information, have a look at sites like codeguru, jguru,...
  12. Replies
    1
    Views
    1,061

    Re: List Arraylist Question

    Hi,

    <Car> is a generic, and by using it you are telling the VM that all objects inside the List will be of type Car, so when you retrieve an object from the List you won't have to cast it to a Car...
  13. Replies
    8
    Views
    1,401

    Re: Vector Retrieval Efficiency

    Click on the link in my signature to see how to use them. They format your code so we can read it, otherwise your code is impossible to read.
  14. Replies
    5
    Views
    1,462

    Re: Help with Java Program

    Two words "Code Tags"
  15. Replies
    8
    Views
    1,401

    Re: Vector Retrieval Efficiency

    And please use code tags when posting code, it makes it a whole lot easier to read. I actually never went over your code because it hurts my eyes at the moment. So if you want more help with your...
  16. Replies
    8
    Views
    1,401

    Re: Vector Retrieval Efficiency

    When a code block is labeled as synchronised then only one thread can execute the containing code at a time, so there is a lock on the synchronised block. If other threads are also trying to execute...
  17. Replies
    8
    Views
    1,401

    Re: Vector Retrieval Efficiency

    Hi,

    Try using ArrayList instead of Vector if you DON'T need synchronization. Vectors are synchronised and ArrayLists aren't, this means that if you don't need the List to be synchronised you are...
  18. Replies
    4
    Views
    1,104

    Re: Do..While - No termination.

    Using == on a String compares if the 2 objects you are comparing are the same object, it doesn't compare the actual contents of the String.
  19. Replies
    4
    Views
    1,104

    Re: Do..While - No termination.

    Hi,

    You can't compare a String with == or with != you need to use the equals method. eg:


    (! name.equals("q"))


    Hope This Helps
  20. Replies
    6
    Views
    1,068

    Re: Distributing applets

    I was just thinking about your problem and came to this conclusion. I'm not sure how your applet works or what it does, but there is obviously some code there, that you don't wan't ppl to have access...
  21. Replies
    6
    Views
    1,068

    Re: Distributing applets

    That is exactly how I would do it.



    You can't really avoid it, you can try obfuscate your code, which will make it more difficult to interpret, search google for "obfuscate", it should give you...
  22. Replies
    6
    Views
    1,068

    Re: Distributing applets

    Hi Theodore,

    Well, the .class files will have to be downloaded over the net, in order for the clients pc to run the applet. So they might have access to the .class files. And any .class file can...
  23. Thread: Execute a file

    by Bnt
    Replies
    3
    Views
    1,523

    Re: Execute a file

    Hi

    Depending on what version of JDK you are using there are 2 different methods of doing this. Prior to JDK 5 version, have a look at the Runtime class, from JDK 5 and up have a look at the...
  24. Replies
    1
    Views
    969

    Re: JSP DataTime Picker problem

    Hi,

    JSP doesn't have a date picker. What you need is a javascript date picker and you can find many of them on the web just by searching google, have a look HERE

    Hope This Helps
  25. Thread: A few things...

    by Bnt
    Replies
    17
    Views
    2,468

    Re: A few things...

    You could also convert the number to a String, strip of the minus sign, convert all the characters back to integers and then add them.



    public int addDigits(int num){
    String s =...
Results 1 to 25 of 685
Page 1 of 28 1 2 3 4





Click Here to Expand Forum to Full Width

Featured