java

How to simulate the Out Of memory : Requested array size exceeds VM limit

I used the Out Of Memory help from sun's site. Where it is quoted as Out Of Memory : Requested array size exceeds VM limit This indicates that the application attempted to allocate an array that is larger than the heap size. For example, if an application tries to allocate an array of 512MB but the maximum heap size is 256MB, then this...

what are the various other programs using which i can connect to odbc database besides ms-access.

what are the various other programs using which i can connect to odbc database besides ms-access. i'm talking about programs in which i can run sql queries. i dont want to use ms-access because the size of the access file has become 1.5 gb . why my database is 1.5 gb ? i am using access to connect to odbc - mysql database . which is q...

How to send arbitrary parameters to Oracle trigger?

The purpose is to send extra information to triggers like current user id from a web application. Since a connection pool is used, and same user id is used for all connections how do I pass the original web user id to trigger? This I need to implement without touching application code. It is a java based application. John ...

Java time-efficient sparse 1D array (double)

Hi, I need an efficient Java structure to manipulate very sparse vectors of doubles: basic read / write operations. I implemented it in a HashMap but the access is too slow. Should I use another data structure? Do you recommend any free library? Looking for some peaceful advice :) Thanks a lot, Marie ...

java:getting sqlexception message "incorrrect syntax near '{' ".

platform :sql server 2000 java 1.4 String queryStringForCustomer = "{call MIGRATE_CUSTOMERS_FILE(?,?)}"; String queryStringForCard = "{call MIGRATE_CARDS_FILE(?,?)}"; for(int i=0;i<recordIds.size();i++) { if(FileType.equals("1")){ callableStatement = connection.prepareCall(queryStringForCustomer); callableStatement.setString(1,(Str...

Java + MS Exchange: how to retrieve .msg files

Dear people, I've created a Java program with which I can retrieve mail from an Exchange mailserver. Problem is: the mail is in EML format and I need the MSG format! Right now I'm retrieving mail through the web access part of Exchange, using the Apache Slide project... is it possible at all to use java to retrieve msg files from an Ex...

Is code injection possible in Java?

Hi, nowadays you can read much about code injection, exploits, buffer-, stack- and heap-overflows etc. leading to inject and run code. I wonder what of this stuff is relevant for Java. I know, there are no pointers in the Java language. But doesn't the JVM organize data in heaps and / or stacks? I know there is no eval function (like ...

JavaServer Pages: How to get a value into an attribute from code without Expression Language?

I am using the MyFaces 1.1 ValidateRegExpr tag to validate the input from a user against a regular expression. I would like to be able to dynamically assign the regex pattern via code, but according to http://myfaces.apache.org/commons11/myfaces-validators11/tagdoc/mcv_validateRegExpr.html the attribute pattern does not support Expressi...

Sax parser: Ignoring HTML

Hello, I am using the sax parser to parse a XML file. It works fine, but I don't want to parse the content of an <info> tag as it contains HTML which I want to save to a string. Can anyone tell me is there any way to go about doing this?. Thanks ...

java bean to wsdl - how to make fields nillable?

I'm using JAX-WS api for wsdl generation. Java-bean class is something like: public class MyBean { private String nullableField; private String notNullableField; // and here appropriate get/set/ters } When wsdl is generated then nullability of this fields is not specified. Question: what (and where) necessary to specify...

Swing question / JTree / custom tree model

Hello, I'm having a problem and hope, someone knows what's going wrong and why and is able to give me the explanation of what I'm missing out right now to make that thing work as suggested. I have a JTree which is build upon a custom TreeModel ("WRTreeModel", see below). The data structure this model shall be used for is build of an ro...

matlab matrix functions in java

I have noticed that matlab does some matrix function really fast for example adding 5 to all elements of an n*n array happens almost instantly even if the matrix is large because you don't have to loop through every element, doing the same in java the for loop takes forever if the matrix is large. I have two questions, are there efficie...

How to change endianness when unmarshalling a CDR stream containing valuetype objects in Java.

I've got marshaled CDR data all by itself in the form of a file (i.e., not packed in a GIOP message) which I need to unmarshal and display on the screen. I get to know what type the data is and have working code to do this successfully by the following: ValueFactory myFactory = (ValueFactory)myConstructor.newInstance( objParam ); Stream...

Where are the Spring MVC validation error codes resolved?

I am attempting to write validators under the Spring MVC framework, but there is a glaring omission in the documentation. When calling passing an error to the Errors object most of the methods expect an String parameter named errorCode. These errorCodes, if I understand correctly serve as stand ins for specific error messages. But I can'...

mysql query which selects from another mysql query

i am migrating from ms access database to mysql database with java frontend so that my application can be used in linux as well . in ms access here's what i would do go to create query . write a select statement . call give the name of the query as query1. when double clicking on query1 you would get the result of select statement in ...

cloud hosting vs. managed hosting

Hi all, It seems the hype about cloud computing cannot be avoided, but the actual transition to that new platform is subject to many discussions... From a Theoretical viewpoint, the following can be said: Cloud: architectural change (you might not install anything you want) learning curve (because of the above) ...

How to change the encoding of wsimport-generated files?

I am using the wsimport ant task of JAX-WS to generate sources based on some wsdl. However, these generated sources all seem to be UTF-8 encoded. Is there a way to change the encoding of the files wsimport task produces? ...

Java OutOfMemoryError message changes when trying to create Arrays of different sizes

In the question by DKSRathore How to simulate the Out Of memory : Requested array size exceeds VM limit some odd behavior was noted when creating an arrays. When creating an array of size Integer.MAX_VALUE an exception with the error java.lang.OutOfMemoryError Requested array size exceeds VM limit was thrown. However when an array was...

InetAddress.getLocalHost() throws UnknownHostException

Hi, I am testing our server-application (written Java) on different operating systems and thought that OpenSolaris (2008.11) would be the least troublesome due to the nice Java integration. Turns out I was wrong, as I end up with a UnknownHostException try { computerName = InetAddress.getLocalHost().getHostName(); if (computerName.i...

Presentation technology for multiple devices

Our application is supposed to serve multiple devices, from simple to smart-phones, IPhones, touch-screens to normal browsers. Application is layered, so we can reuse the business and persistence layer. However, we would like to program single presentation layer as well. I know for example that ASP .NET generates different html output ...