Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. CatWeasel

    how to solve java.lang.OutOfMemoryError.

    I'm using weblogic locally to test my servlets before i deploy them. Weblogic (fortunately) is also a Java-application which i execute with the -Xmsn option to increase the initial memory usage (This also includes the memory usage for the servlets). The only sugestion that i can give you is to...
  2. CatWeasel

    how to solve java.lang.OutOfMemoryError.

    have you tried to run the program with the -Xmsn option. A possible option can be -Xm48M, then you start with a minimum memory space of 48M. Perhaps this helps, Steven.
  3. CatWeasel

    Assing JSP value to Javascript variable

    I think that the problem is that you use <% =myJSP %> instead of <%= myJSP %>. The difference between those two is that the first JSP code is copied directly into the servlet that is generated and tries to perform the statement ' =myJSP'. The second statement prints the value of the variable...
  4. CatWeasel

    Problem with nested try-catch...

    I tried a similar simulation myself and it worked for me. It's possible that you've narrowed the Exception to hard or ask for an other exception than that is thrown. Try to include all the exceptions that are thrown in the second try/catch block (for instance, the NullPointerException can also...
  5. CatWeasel

    compare a float with NULL

    try this in instead: if(request.getParameter(&quot;budget&quot;) != null) myObj.Myfloat = Float.parseFloat(request.getParameter(&quot;budget&quot;)); Hope this helps, Steven.
  6. CatWeasel

    How do you set the value of a Float, aside from using 'new'?

    perhaps you can use this: try { accum += Float.parseFloat(textbox.getText()); } catch(NumberFormatException) { System.out.println(&quot;No real float in textbox&quot;); } textbox.setText(&quot;&quot;+accum); //instant conversion from float to String Hope this helps, Steven.
  7. CatWeasel

    compare a float with NULL

    if the float in your object is of type Float then you can use (myObj.Myfloat == null) but if you use the primitive float, you can't compare it to null. There i would recommend the NaN value as initialisation and comparing. Hope this helps, Steven.
  8. CatWeasel

    cast problem

    try this then: myRespObj.budget = new Float(rs.getFloat(&quot;ChgeRate&quot;)); Hope this helps, Steven.
  9. CatWeasel

    cast problem

    No parseInt() and intValue() are not the same. - intValue() returns the int value represented by that Object (in your case a Integer). - parseInt(String s) returns the int represented by the string. This string must be only decimals. only the first character can be a '-'. Hope this helps, Steven.
  10. CatWeasel

    Format numbers using DecimalFormat

    As far as i read in the java doc, the # defines that the value can be absent. If you'll use the pattern &quot;0.000&quot; will be convert 5,0 -> 5,000. Hope this helps, Steven.
  11. CatWeasel

    getting font error with javac

    Here is the solution from Borland: These errors happen because the Java Virtual Machine (JVM) that is running JBuilder can't find a font that has been specified. The font that the JVM is looking for is &quot;symbol.ttf&quot;. This font should be available on any Windows machine. You need to...
  12. CatWeasel

    dynamic hashtable

    If it's only about strings that you want to use then you can use java.util.Properties. It extends Hashtable and has also the functions load and store, which provide the functionality for you. If it's about object's you'll have to write the function's yourself. Hope this helps, Steven.
  13. CatWeasel

    hi all I need to save the values f

    Sorry for this late reply, but i was on a needed vacation for a long weekend. I've tested the fnuction myself in a servlet and it creates a .csv file in the root of the webserver. Can you send me your servlet so that i can see what the possible problem is? Greetings, Steven.
  14. CatWeasel

    hi all I need to save the values f

    Hi, here is a little function that i just made. The only thing that you have to do is to create the FileWriter for the csv and catch the exceptions. private static void writeResultSet(ResultSet resultSet, Writer output) throws SQLException, IOException { int cols =...
  15. CatWeasel

    can you get array index?--b[4]...index=4??

    Before i forget, if you want to manipulate the array, you also can look to java.util.Arrays. This class contains some functions for manipulating mainly primitive arrays. Greetings, Steven.
  16. CatWeasel

    can you get array index?--b[4]...index=4??

    That depends on how you access it. To control the index of the array, you can use it within a for-loop, like for(int index = 0; index < array.length; index++) { //do something with array[index]; } But if you supply for example array[2] to a function, you'll loose the array, but get the...
  17. CatWeasel

    ItemListener().....need help?

    As far as i can see the error that you get is the undefined variable on radiob1. This will be solved if you declare the buttons global in your code. // global declaration of the buttons and other stuff private JRadioButton radiob1; private JRadioButton radiob2; private ButtonGroup radiogroup...
  18. CatWeasel

    can you get array index?--b[4]...index=4??

    There is a easy way to get the length of an array: use length. It will return the length of the array. Greetings, Steven.
  19. CatWeasel

    Semaphores

    You can look at the use of &quot;wait, notify, notifyAll&quot;. These work together as semaphores. The following code example is from the Java tutorial. It shows a little of how it's used with a producer/consumer combination. public synchronized int get() { while (available == false) {...
  20. CatWeasel

    Parsing Files In Java !

    For directly processing a file you can use java.io.RandomAccessFile. This class supports both reading and writing without having to open a separate Reader and Writer. This class also has a readLine function that returns Strings. Perhaps this is a solution for you. Greetings, Steven.

Part and Inventory Search

Back
Top