Hi,
I tried to create byte array blocks from file whil the process was still using the file for writing. Actually I am storing video into file and I would like to create chunks from the same file while recording.
The following method was supposed to read blocks of bytes from file:
private byte[] getBytesFromFile(File file) throws IOEx...
Hi guys,
I'm writing a spreadsheet with JExcelApi.
I have two cells that I want to apply currency formatting to. From reading the API I discovered jxl.write.NumberFormat, which seems to do what I want. In my application I've written:
NumberFormat currency = new NumberFormat(NumberFormat.CURRENCY_DOLLAR);
WritableCellFormat currencyF...
I want to compress an image using JPEG encoder and instead of writing it to a file I want to pass the compressed data to another application. My problem is that I can compress the data but don't know how to get that compressed image data. I am using this code :
out = new FileOutputStream ( filename );
JPEGImageEncoder encoder = JPEGCo...
After recently installing Windows 7 Professional, I'm getting a strange problem removing a TableItem from a populated Table in SWT. It is specific to Windows 7 and to the SWT.VIRTUAL style constant for the table.
Consider the following code:
table = new Table(parent, SWT.VIRTUAL | Skin.SCROLL_STYLE |
SWT.FULL_...
Hi All,
I am getting a NullPointerException Exception while adding data from the online JSP page.
The error description is as follows:
javax.transaction.TransactionRolledbackException: CORBA
TRANSACTION_ROLLEDBACK 0x0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK:
javax.transaction.TransactionRolledbackException: ; ne...
I've made my entity classes Adress, Road and County. A Road is in a County and an Adress in on a Road. I would like to list all the Adresses in a County. Therefore, in my AdressService I say:
public List<Adress> AllAdresses(County county) {
Adress adress = new Adress();
Road road = new Road();
road.setCounty(county);
adress.setR...
Hello, I am getting the following error:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:203)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExe...
I have a requirement to print my list in two columns along with pagination.
I am not able to figure out how will I get 2 records at a time from the list set in the datatable.
...
Am trying to do update a clob column using a connection object that is retrieved using Apache DBCP connection pooling.
Earlier, I've implemented connection pooling using this and it was working fine i.e am able to update CLOB. I switched to DBCP because I was getting java.sql.SQLException: ORA-01000: maximum open cursors exceeded. I've ...
We have a web-application that lets the users trigger a request to an external resource. The external resource spends an unspecified amount of time to gather results, so we have to poll it to get updates, and to collect the final results when they are done.
We wish to make it so that when the user triggers the request, it gets added to ...
I am using several packages which are configured by using configuration properties for example org.apache.ws.security.crypto. Normally a single configuration file suffices but I now have a need to override one or more of the properties whenever they are used by code which is called from a particular object instance.
I am far from a java...
We're trying to use Apache Commons VFS to access something over SFTP. It claims to support SFTP, however we're getting a MalformedURLException when it starts. Digging around I see that apache vfs is using java.net.URL. However the documentation tells me that it doesn't actually support sftp:// URLs.
Protocol handlers for the followin...
Can you advise me as to some useful Java books to read first?
...
Hello everyone,
I must not be very good at googling today. I want to set the option that appears in the applet config that disable applets for being able to access the certificate store of the browser, but not for all the applets, just for one applet.
Do you know where can I find all the applets options?
Regards
...
I want to be able to change the base millisecond reference from 1970 to 2008 in java so
that I can save space in the database and unique Ids.
Preferably with Joda-Time.
The upcoming jsr-310 in the supposed java 7 release implements it.
In the The Discrete Timeline section of this link it states that the counting of milliseconds has ch...
Hi.
I stumbled upon a very puzzling feature(?) of Java.
It seems that using a "new" keyword to replace a method argument kind of shifts that object into a different scope:
import java.util.ArrayList;
public class Puzzle {
public static void main(String[] args) {
ArrayList<Integer> outer = new ArrayList<Integer>();
...
We are looking at speeding up a project with new developers. How long is a typical Java + OpenGl learning curve if anyone has any experience ? The core work is on detailed globe visualization.
...
Is there a portable way to request a Servlet container to shutdown gracefully, from within a servlet?
By portable I mean a technique that will work on all standard compliant containers (Tomcat, Jetty, Winstone, etc).
Note that this is the opposite of the Servlet.destroy() method, which gets called when the container is taking the servl...
I have some entity:
public class Album extends GenericAuditedEntity {
@OneToMany(fetch = FetchType.LAZY)
private Set<Item> itemSet = new HashSet<Item>();
}
And when i run HQL like this:
em.createQuery("select a from Album a").getResults()
it produses many SQL queries:
One for select data from Album's table. Smth like thi...
I've been reading about Rhino as a useful way to implement JavaScript inside my Java code.
After reading for a while, searching in google and here, I couldn't find a real reason for which I would use JavaScript inside Java.
Could you point some real world advantages you find on using Rhino for a regular Java application?
...