java

How to implement Bouncy Castle Rsa encryption in Black Berry Application

Hi, Can anyone provide me feed back on How to implement Bouncy Castle Rsa encryption in Black Berry Application Thanks, Bapi ...

XML Schema Validation in Android

Hi, I have created an XML and i want to validate with schema i.e, xsd file but there are no direct classes provided by android for the same if i am not wrong ......... and there is an external jar named jaxp1.3 which doesnt allow me to compile the code is it because the bytecode of desktop and android are different? which has the cl...

Configure Hibernate to use Oracle's SYS_GUID() for Primary Key

I am looking for a way to get hibernate to use oracle's SYS_GUID() function when inserting new rows. Currently my DB tables have SYS_GUID() as the default so if hibernate simply generated SQL that omited the value it should work. I have everything working, but it is currently generating the UUID/GUID in code using the system-uuid genera...

Java Bind Exception

What would cause a TCP socket to throw "java.net.BindException: Address already in use" even when reuse address is set to true? This only occurs if the application is quickly restarted. Running on CentOS 5 linux OS. ...

How to pass in credentials when connecting to sonatype nexus (anonymous login disabled) ?

In eclipse, the m2eclipse plugin will prompt me for my credentials when I'm building a maven2 project. And it compiles fine. But if I now try to run "mvn install" from the command line, I get an artifact not found error. How do I add the username/password into my pom.xml in order to solve this problem. Thanks ...

how to compare two msword document in java ?

I am looking for a Java API which can compare two microsoft word documents. We want to compare two msword document and things which are not common that we have to highlight with some color or any other way ... So I thing we have to merge both document and highlight content which are not common. We are using Linux server so we can't ins...

Desktop application in java with database

I am trying to implement an application for a friend who sells t-shirts and hats, so we are dealing with interconnected tables. I was wondering what would be the perfect libraries to achieve this goal. What kind of database should I use to make it portable and easy to deploy. I would really like to insist on the database stuff, what shou...

MyEclipse: Is still worth to use it?

Since 2005 we are using MyEclipse as our standard development tool. We use it mainly for for Java applications, but from time to time we use it also for Groovy and may be other stuff, like DB navigator, etc. Our licences should be renewed in a couple of months and I am rethinking the decision of using it. A nice feature of MyEclipse w...

What is the best way to 'ping' a database via JDBC?

I'm trying to determine the best way to ping a database via JDBC. By 'best' I mean fast and low overhead. For example, I've considered executing this: "SELECT 1 FROM DUAL" but I believe the DUAL table is Oracle-specific, and I need something more generic. Note that Connection has an isClosed() method, but the javadoc states that this...

how to close hibernate tools db connections

When developing a new project I often want to re-create the schema to apply any new entities or relationships created. I like using hibernate tools in eclipse, but it's a pain when wanting drop and re-create the schema - since it seems to maintain open connections to the db (postgres in this case). Does anybody know if there is an easy ...

when we use Semaphore in consumer and producer buffer

I am working on BoundedBuffer class in consumer and producer we want to use the Semaphore in that class we did that but there are an error in every use of acquire() the rerror is: unreported exception java.lang.InterruptedException; must be caught or declared to be thrown Here is the code: import java.util.concurrent.Semaphore; publi...

What are Java's native ways of communicating with devices directly?

What are Java's native ways of communicating with devices or ports such as LPT1, COM1, USB directly? ...

Java EE and application servers - What can i do?

Hi everyone! I decided that it is time for me to dig into the whole Java EE stuff. I am using EE some techniques whithin Java SE like JPA or JMS, but i still messing around with Java SE and i believe Java EE and an application server will solve some of my problems i have. BUT: I have still some questions after reading some articles on ...

Writing functional programs in non-functional languages

Suppose I write a program using immutable data structures in Java. Even though it is not a functional language, it should be able to execute parallely. How do I ensure that my program is being executed using all the cores of my processer? How does the computer decide which code can be run parallely? P.S. My intent in asking this questi...

Java - Store GMT time

Hi, i have a question: My server has GMT+7, so if i move to another server has another GMT timezone, all date stored in db will incorrect? Yes Q1 is correct, how about i will store date in GMT+0 timezone and display it in custom GMT timezone chosen by each member How i get date with GMT+0 in java ...

Check and insert alt attribute for images which miss it

I want to write a Java tool to assess HTML pages of an existing site and if any image has no alt attribute, the tool will insert alt="" to that image. One approach is using an HTML parser (like HtmlCleaner) to generate the DOM then adding the alt attribute to the images in the DOM before writing back the HTML. However, this approach ...

Converting a WSDL file into XSD file in java

Hi I want to convert a given WSDL file into a XML schema programatically. I need the schema for validating my SOAP responses against it. Can anyone help me with the same? Thanks in advance. ...

Java date iterator factory, with rules specifying how to calculate the intervals

I am looking for a Java class where I can specify a set of date rules, such as "every 3rd sunday" and "the first occurrence of a monday every second month". I want to be able to get something like an infinite iterator out of it (.next() would return the next date matching the rules set). I think I'd be able to build it myself - but cale...

bad version in class file

Hello, When I use certain jars in one of the connector projects i write for lombardi in TeamWorks eclipse i get a bad class version exception... any ideas how this might be resolved.. Regards, Adhir ...

Where to save pictures on Android?

My application uses quite a lot of pictures that are downloaded from the internet and cached locally on the Android phone. I am wondering, what is the correct way to save those pictures. There are several ways I see, that are not fully satisfying. Save them on SD Card in a public folder Uses up space that wont be freed on uninstall Us...