I'm looking for a built-in Java functions which for example can convert "\\n" into "\n".
Something like this:
assert parseFunc("\\n") = "\n"
Or do I have to manually search-and-replace all the escaped characters?
...
I am trying to create a dump file from a database using JDBC. The file should be round about 300 mb in size containing 1.2 to 1.5 millions records across ten columns but I run out of memory at about 250 thousand.
My question is does java store the entire recordset in memory? I have set the recordset to be readable only forward in th...
Hello everybody,
I need to send xml to the browser with my jsf application. This xml is generated by the application.
I try to create it but my jsf application sends html every time.
How can I change the content-type to send xml ?
Thanks for your help.
...
i have a hibernate query that is dynamically put together using the criteria api.
it generates queries that are unbearably slow, if executed as-is.
but i have noted they are about 1000% faster if I prepend /*+ FIRST_ROWS(10) */ to the query. how can i do this with the criteria api?
i tried criteria.setComment(..), but this seems to be ...
What is the equivalent of Java's final in C#?
EDIT: Sorry, I should have been clearer. I meant what is the equivalent when applied to a member variable - so it must be assigned once and only once.
...
Hi,
I am used to using JMock in Java which allows you to specify things such as any(String.class) as an expected argument - which .NET frameworks offer similar functionality?
...
Hi
I have the following class
@Entity
public class Foobar {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@ManyToOne
private Organization organization;
private Long orderNr;
}
What I'm trying to do is to create an incrementing order number for this object. The problem is that the order...
Hi,
I am getting the fatal error while executing makefile. I have given the makefile and error. I have used "jdk 1.6 update 16" and "openSUSE ver 11". Pls help me to fix the issue. Thanks.
**********
makefile:
**********
# Makefile for jni-bouncestudio
CC=gcc
CSRCS=JNIBounceStudio.c
COUT=libJNIBounceStudioNative.so
CFLAGS= -shared ...
I have a Java program that runs a number of other programs. Once the user is finished they have a button to kill all processes, this should kill everything that is running but it should do it with forcing them. At least one of these other processes is also written in Java and has a number of shutdown hooks as it automatically saves a pre...
Searching a file which is written in Hindi(Devanagri) (UTF-16) gave rise to the following problem.
The file contains:
त्रास ततत
जुग नींद ना हा बु
Note that the first char 'त्र' is a multiple code point of त + ् + र
Now while searching for 'त' I get 4 matches including the त of the first char. I am using Java.
How can I go abo...
Hi,
I need to develop an application that connects to various DSN's using the Microsoft ODBC drivers. I have developed the application in Eclipse and it seems to work properly. The connection succeeds and I am able to view table data.
However when I export the project to a runnable jar file (using Eclipse) the functionality fails for O...
I am running a window/linux java application which connects to a server for market information. I'm trying to test our re-connect logic and don't have access to bouncing the server. Is there a way on windows and linux to kill or interrupt a socket?
...
I am currently displaying a ticket number like so.
<h:outputText value="#{ticket.ticketNumber}" />
Instead of this I want a hyper-link to a URL.
The address will look similar to this: http://testserver.com/viewer.jsp?ticket=#{ticket.ticketNumber}
So, the new code might look something like this (note the code below doesn't work, jus...
Is there any way to determine how many threads can specific JVM + Application Server combination handle? The question is not only about web application request serving threads, but also about background threads.
...
I have a web application that reads content from a property file. When will this property file be loaded into memory. ie. Once I deploy the application with some content in the prop file, and after deployment , I change the contents of the prop file, will the changes be reflected or do I have to redeploy?
EDIT : An accessor class' stati...
I am in the process of turning my java application into a web applet. So far I can export the jar, sign it, and apparently launch it. The Java loading image plays endlessly and my application's JFrame window pops up and connects to my application's server. Unfortunately, as an applet, the JFrame seems to be frozen. It never renders anyth...
Given the following string:
"foo bar-baz-zzz"
I want to split it at the characters " " and "-", preserving their value, but get all combinations of inputs.
i want to get a two-dimensional array containing
{{"foo", "bar", "baz", "zzz"}
,{"foo bar", "baz", "zzz"}
,{"foo", "bar-baz", "zzz"}
,{"foo bar-baz", "zzz"}
,{"foo", "bar", "baz-z...
I'm trying to get a servlet built and running in Netbeans to run on a jetty server.
Deploying locally always works, however deploying on Jetty results in a directory listing rather than the servlet actually running.
The problem seems to be with the context configuration, but I have no idea what I'm doing wrong.
Here is the XML for web...
I have this entity class, called "Pagina" and I want to update the entry in the database based on the changes made to the entity. This isn't working. I get no errors, but the db is not changed.
@Entity
@Table(name = "PAGINA")
@NamedQueries({@NamedQuery(name = "Pagina.findAll", query = "SELECT p FROM Pagina p"),
@NamedQuery(name = "Pag...
As I understand it, a J2EE container is required to include a JMS provider. Is it possible for a standalone Java application to send messages to a JMS queue provided by the container? If so, how do I access the JNDI lookups from outside the container?
(I am trying this with Geronimo if it makes any difference, but I am hoping there is a...