java

How do I configure a project to use latest Derby DB version (10.4)?

Every time I try to run a small application that uses a Derby DB I get this error message: Message: Database at /path/to/db/TheDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.4. I've added the library from Netbeans, and still have the same problem. I'm n...

When to use Hibernate/JPA/Toplink?

Right now I'm making an extremely simple website- about 5 pages. Question is if it's overkill and worth the time to integrate some sort of database mapping solution or if it would be better to just use plain old JNDI. I'll have maybe a dozen things I need to read/write from the database. I guess I have a basic understanding of these tech...

throw exception from a JSP

Hi, Is it possible to throw an exception in a JSP without using scriptlet code? Cheers, Don ...

Which Java-library can be used to access data via WebDAV?

That's the question: Which library can help me to access data available via WebDAV in my Java-programs? OpenSource is preferred. ...

Help configuring JNDI with embedded JBoss in Tomcat 5.5.x

When I try the following lookup in my code: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); return (DataSource) envCtx.lookup("jdbc/mydb"); I get the following exception: java.sql.SQLException: QueryResults: Unable to initialize naming context: Name java:comp is not bound in th...

Is there a Java equivalent for .Net System.Data?

Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly the DataSet and Adaptor classes ? ...

pl sql & java - creating dynamic query

Hi I have a dilemma, I'm using java and oracle and trying to keep querys on plsql side. Everything is OK, until I have these complex querys which may and may not have conditions. Its not hard in Java to put together WHERE clause with conditions, but its not nice. And in pl sql side I also found out that the only possibility for 'dynamic ...

Static layers in a java web application

I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered design. To save me from constantly having to create instances of my service layer/data access layer classes, I have made the methods in them all static. I shouldn't get concurrency issues as they use local variables etc and do not shar...

java sound without hardware device

Hello, Anyone know if it is possible to write an app that uses the Java Sound API on a system that doesn't actually have a hardware sound device? I have some code I've written based on the API that manipulates some audio and plays the result but I am now trying to run this in a server environment, where the audio will be recorded to a ...

Determine the ID of the JSF container form

I need to determine the ID of a form field from within an action handler. The field is a part of a included facelets component and so the form will vary. included.xhtml <ui:component> <h:inputText id="contained_field"/> <h:commandButton actionListener="#{backingBean.update}" value="Submit"/> </ui:component> example_containing.xh...

Ant Junit tests are running much slower via ant than via IDE - what to look at?

I am running my junit tests via ant and they are running substantially slower than via the IDE. My ant call is: <junit fork="yes" forkmode="once" printsummary="off"> <classpath refid="test.classpath"/> <formatter type="brief" usefile="false"/> <batchtest todir="${test.results.dir}/xml"> <formatter...

What causes java.lang.IllegalStateException: Post too large in tomcat / mod_jk

what configuration needs to be tweaked, and where does it live, in order to increase the maximum allowed post size? ...

Image database build in Oracle - Is an e-commerce style interface workable?

Question Can I build a image database/library that has an e-commerce style checkout system and a powerful search in Oracle/Java? Are there existing elements out there I should be aware of? Or, is this better in another dev environment like PHP/MySQL? Overview I am working on an image database/library dev team on the UI side of things,...

debug JSP from eclipse

Hi, Does anyone know of a good tool for debugging JSPs from within Eclipse? I'd like to be able to set and watch breakpoints, step through the Java code/tags, etc within Eclipse while the app is running (under JBoss in my case). Presumably it's reasonably straightforward to debug the servlet class that's generated from a JSP, but it's ...

How to get the temperature of motherboard of a PC (and other hardware statistics)?

Hello, does any one know how to get the current motherboard, processor or HD temperature statistics? In GNU/Linux, I know I could use something like hddtemp or sensord to get the info, and then parse it... but in Windows: How can I do this? And, Can it be done with with C# or Java or any other hight level programming language? Thanks! ...

Access Enum value using EL with JSTL

I have an Enum called Status defined as such: public enum Status { VALID("valid"), OLD("old"); private final String val; Status(String val) { this.val = val; } public String getStatus() { return val; } } I would like to access the value of VALID from a JSTL tag. Specifically the test attri...

How can I share a variable or object between two or more Servlets?

I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some "standard" way. I suppose that this is not a good practice but is a easier way to build a prototype. I don't know if it depends on the technologies used, but I'll use Tomcat 5.5 Thanks. I want to share a Vector of obj...

Use continue or Checked Exceptions when checking and processing objects

I'm processing, let's say a list of "Document" objects. Before I record the processing of the document successful I first want to check a couple of things. Let's say, the file referring to the document should be present and something in the document should be present. Just two simple checks for the example but think about 8 more checks b...

Is OOP & completely avoiding implementation inheritance possible?

I will choose Java as an example, most people know it, though every other OO language was working as well. Java, like many other languages, has interface inheritance and implementation inheritance. E.g. a Java class can inherit from another one and every method that has an implementation there (assuming the parent is not abstract) is in...

Which JMS implementation do you use?

We are using ActiveMQ 5.2 as our implementation of choice and we picked it a while ago. It performs well enough for our use right now. Since its been a while, I was wondering what other Java Message Service implementations are in use and why? Surely there are more than a few. ...