How to see if a substring exists inside another string in Java 1.4
How can I tell if the substring "template" exists inside a String in java 1.4 It would be great if it was a non case sensitive check. Thanks! ...
How can I tell if the substring "template" exists inside a String in java 1.4 It would be great if it was a non case sensitive check. Thanks! ...
I am revisiting a project and need to limit it to Java 1.4 (unfortunately). I was interested in introducing a MVC framework to improve ease of maintenance in the future. Besides Struts 1, what options do I have? The lightweight the framework, the better. Not to dismiss Struts off hand, I've just heard a lot of bad things about it. If a...
Could someone give me an example of the best way to add an iterator to a custom class pre Java 5's iterable interface? Would wrapping a Collection be the best option? Something like public Iterator iterator() { return wrappedCollection.iterator(); } In my initial post I confused Iterator with Iterable. The end result I am interes...
We are stuck with Java2SE v1.4 till the end of 2010. That's really nasty, but we can't help it. What options do we have to use some of the new features already now? I can think of several ways like changing the bytecode, e.g. using Retrotranslator or Retroweaver. backport of libraries, e.g. Concurrent Backport, but this does not help f...
Since Java 1.4 doesn't have enums I'm am doing something like this: public class SomeClass { public static int SOME_VALUE_1 = 0; public static int SOME_VALUE_2 = 1; public static int SOME_VALUE_3 = 2; public void receiveSomeValue(int someValue) { // do something } } The caller of receiveSomeValue...
What is the best/foolproof way to get the values of environment variables in Windows when using J2SE 1.4 ? ...
If I compile an application using Java 5 code into bytecode, are the resulting .class files going to be able to run under Java 1.4? If the latter can work and I'm trying to use a Java 5 framework in my Java 1.4 application, is there anything I should watch out for? ...
i am reading records data from a file(records count can be up to thousands ).Now i want to insert each record in to database.I want to insert all of records in one hit to reduce performance hit. If i use addBatch(String sqlQuery ) on statment object,my sql query should be static .but in my case query will be non static.Please tell me pos...
When passing a final object (A String in the code below) it shows up as null when printed from the anonymous inner class. However, when a final value type or straight final String is passed in, its value is correctly displayed. What does final really mean in context of the anonymous inner class and why is the object passed null? publi...
We want to implement web services on our Weblogic 8.1 Java 1.4 application. We want to create new server services and call services in other apps. And we need to stick with Java 1.4 (for now). Due to 1.4 we can't use frameworks like Restlet or Jersey. Are there any good web service (preferably REST) API frameworks that support Java 1...
sql server 200 java 1.4 jboss 3 HI am getting exception message "You cannot set autocommit during a managed transaction" code is below try { try { connection = getConnection(); } catch (Exception e) { throw new ConnectionException(e.getMessage()); } for(int i=0;i<recordIds.size();i++) { String cu...
platform: Sql server 2000 java 1.4 ejb 3.0 ...
I am able to encrypt with AES 128 but with more key length it fails. code using AES 128 is as below. import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.io.*; /** * This program generates a AES key, retrieves its raw bytes, and * then reinstantiates a AES key from the key bytes. * The reins...
I am using same user name and password login for a user on two web applications (one in .net 3.5 and other in java 1.4). Both websites are using different database on same server.For maintaining user name password authentication .net user login-control is used.when user updates his password we need to update same password in database use...
When I try to post the XML to an SSL link by the following code public void send(String url, String xmldoc) { StringBuffer sb = new StringBuffer(); try { ByteArrayInputStream bais = new ByteArrayInputStream(xmldoc .getBytes()); InputSource is = new InputSource(bais); DocumentBuilderFactory factory = DocumentBuil...
There is a standard way to compile a java class from a .java file like do the ToolProvider class of the jdk 1.6 but with Java 1.4: JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); int result = compiler.run(null, null, null, "Hello.java"); ?? Anyone have some idea. Many thanks. ...
I tried compiling my webapplication with javac – source 1.5 – target 1.4 I end up with the error: javac: source release 1.5 requires target release 1.5 Since I’m using generics and other features; when I try compiling with –source 1.4 I end up with the errors: (use -source 5 or higher to enable generics) (use -source 5 or higher to en...
Hi, I have some enterprise apps running on Java 1.4. They mostly invoke Stored Procedures on a DB, Parse XML files (at the most few megs large), read and write from and to disk. We have a requirement where now we have to migrate these apps to Java 6(No code changes to be done at all). My questions: If I don't recompile my apps under...
Hello, I have a test class that has a @Resource annotation for a setter and I need to make it Java 1.4 compliant, so obviously the annotation has to go. I'm using Spring. So, how would I replace something like @Resource("my.resource") so that the setter gets the correct dependency injection? Would I need to make a bean in an xml file? ...
What would be a Java 1.4.2 equivalent of Pattern.quote? I was using Pattern.quote() on a URI but now need to make it 1.4.2 compatible. ...