My Java application require a huge memory heap. I need to launch my application using
java -Xms32m -Xmx128m xyz.jar
Hence, I would like to create native launcher for my Java application, where I can pass the JVM heap size parameters in. I plan to use JSmooth http://jsmooth.sourceforge.net/ for Windows platform.
However, I would also l...
A friend of mine uses in his company an ERP software written in PowerBuilder. Unfortunately the (one and only) developer is going into retirement soon. My friend really likes the software and wants to keep using it for at least ten more years, so my friend decided to buy the source code.
He wants to start a business to maintain the soft...
In Java, given a java.net.URL or a String in the form of http://www.example.com/some/path/to/a/file.xml , what is the easiest way to get the file name, minus the extension? So, in this example, I'm looking for something that returns "file".
I can think of several ways to do this, but I'm looking for something that's easy to read and sh...
Having in mind that each webapp has its own separate database (but all databases are in the same database server).
The scenario is that I have a multi-tenant saas application - I deploy the same application for each customer. Each customer works on a database that is called db_cid, where cid is the customer id, i.e. a a unique customer ...
I'm extending a class (ArrayBlockingQueue) that implements the Serializable interface. Sun's documentation (and my IDE) advises me that I should set this value in order to prevent mischief:
However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID ...
I have a Java method with the following signature:
public <T> List<HtmlOptionsComposite> convertToHtmlOptionsCompositeList
(List<? extends T> objects,
Class<T> clazz,
String getValueMethodName,
String getDescriptionMethodName,
String getDiscontinuedMethodName)
{ ... }
The clazz parameter is required by the ...
I'm using proxool java connection pool (version 0.9.1). Everything works fine till I reach the maximum connection count. If the maximum connection count is reached proxool immediately throws an SQLExcepion:
java.sql.SQLException: Couldn't get connection because we are at maximum
connection count (n/n) and there are none available
Of ...
Is there a native way to sort a String by its contents in java? E.g.
String s = "edcba" -> "abcde"
...
For my current project I have to map a legacy database using hibernate, but I'm running into some problems.
The database is setup using one 'entity' table, which contains common properties for all domain objects. Properties include (among others) creation date, owner (user), and a primary key which is subsequently used in the tables for ...
I have a Java project which will include a number of large SQL statements for querying the database. My question is: where should I store them?
I'm fairly sure I want each statement its own text file managed by source code control. As Java doesn't support multi-line strings I can't easily put the SQL in my .java files and I don't thi...
I want to receive a file from serial port and I have to use that X-modem protocol is designed to receive a file over serial port in Java. So if anyone can have idea about then plz help me. I am in very much trouble.plz
...
I have output messages displayed on the Java console for an application that started using webstart. Instead of the user manually clearing message, is there a way of clearing console messages in code?
These messages are printed at the rate of about 1000 per second and seem to end up using too much memory, i could have stopped the printi...
I've managed to get what I want when mapping with inheritance like this:
ThisClassShouldntExist
freeFlowMsg
errorMsg
BaseForm extends ThisClassShouldntExist
function
subFunction
SpecificForm extends BaseForm
address
My binding.xml:
<binding>
<mapping class="com.struts.form.ThisClassShouldntExist" abstract="true">
<...
I ran across a class that was set up like this:
public class MyClass {
private static boolean started = false;
private MyClass(){
}
public static void doSomething(){
if(started){
return;
}
started = true;
//code below that is only supposed to run
//run if not started
}
}
My understanding with sta...
I have to encode the 5 XML reserved chars (& < > " and ') properly as follows:
"&", "&" "<", "<" ">", ">"
"\"", """ "\'", "'"
I can do them one by one, but is it possible in regexp something like ("[&|<|>|\"|\']", "&|<"); ... etc so that it will not be executed in 5 operations one after another but alltogether s...
I would like to create a unit test using a mock web server. Is there a web server written in java which can be easily started and stopped from a junit test case?
...
Essentially what I am looking for is a good way to build a quick database interface. In my (limited) experience with ASP.net I've used a Gridview control for this task. However for this project I am going to be using Java.
Can anyone recommend a good way to set up a Gridview like control (with editable and sortable rows) in a Java web f...
We have Flex on the front end and Java on the back end. When a user will request for a PDF file, request will go to the Java backend, where a PDF file will be generated using Jasper Reports. What we dont know is how to display this PDF file in browser; since we dont want to use JSP/Servlets etc - It has to be flex only. Any suggestions?
...
What I am trying to do mimic an HTML Select tag. I want to display text as an option but when selected, I would use its value.
For example, I would have a list of country names. However, when a user selects Japan, I want to get the Locale Code for that country. So the user sees that they selected Japan, but my code will get "ja_JP" or s...
Is there a way to visually separate an inherited class member, i.e. a variable that is defined public/protected in a superclass?
I noticed that it's possible to stylize abstract members separately...
I'm using Eclipse Ganymede.
...