devxlogo

Tip Bank

Determining Heap Size

Question: How do I find the size of the heap memory that is available for Java program? Answer: The maximum size of the Java heap is fixed by the JVM

EXE Starts and Ends Immediately

Question: When I build my application as an EXE and run it, the application comes up and then immediately disappears. What is wrong? Answer: You need to create an event

ServerSocket Port Binding Error

Question: My Java server compiles perfectly, but when I try to run it on mymachine I get an error when it tries to open up the ServerSocket onport 2525. I

Entering Information Into Two Tables at Once

Question: I have two tables: Items_table: Item_id (primary key) Description (foreign key) Item_priceDescrip_table: Description (primary key) Item_type How do I enter information into the two Description columns simultaneously? Answer: An

String Search Mechanism

Question: How do I do a string comparison where I want to determine if onestring is contained within another? For example: Str1 = “Degree in IT”;Str2 = “Diploma or Degree

Remote File Size

Question: How can I discover the size of a remote file stored on an HTTP server? Answer: The HTTP protocol supports the transfer of extra information about thecontent referenced by

Date Arithmetic in Java

Question: I have a ResultSet created using JDBC and it contains some datefields. Now I want to subtract one date from the other. Howdo I do this? Answer: Date arithmetic