How can I parse a strings like :
name1="val1" name2="val2" name3="val3"
I cannot use split(\s+) as it can be name = "val 1".
I am doing java but any laguage is okay.
I have a Java program that writes results to both a DB (SQL Server) and a spreadsheet (POI), and it would be best if neither is written to if there's an error with either.
It would be a lot worse if the spreadsheet was produced and then an error happened while saving to the DB, so I'm doing the DB-write first. Even so, I'm wondering if someone knows of a way to guarantee they both succeed or fail as a unit.
Thanks!
We are doing one project. We have to develope website, that displays all proxy servers list and when user click on particular server it will be activated to him.
For this I am confusing on use Java or PHP. which is simple to handle proxys.
Please help me.
Is there a way to obtain the post data itself? I know spring handles binding post data to java objects. But if I had two fields that I want to process manually, how do I obtain that data?
Assuming I had two fields in my form
<input type="text" name="value1" id="value1"/>
<input type="text" name="value2" id="value2"/>
How would I go about retrieving those values in my controller?
Im getting classnotfountexception on Class.forname("com.mysql.jdbc.Driver")
im using:
windows vista 64-bit,
Eclipse Galileo,
GWT framework
i downloaded (mysql-connector-java-5.1.6-bin), but what the exact path i should add to.
im getting this exception while im in gwt-projects, but normal projects working good,
any idea how that should be done???...thanks
I am new to web development, I have to create a web application in Java using GWT that connects to a database and download a file from it. Regardless of the type of database, what does the web application need in order to create a connection with the database? E.g. an API
If every object added to a java.util.HashSet implements Object.equals() and Object.hashCode() in a deterministic fashion, is the iteration order over the HashSet guaranteed to be identical for every identical set of elements added, irrespective of the order in which they were added?
JFace Databinding doesn't support generics, so it isn't particularly type-safe. And apparently it never will, since they wish to preserve Java 1.3 support.
JGoodies supports generics since 2.0.0. Has anyone ported JGoodies 2 to SWT/JFace? Or is there another library which allows both?
I am very new to programming, so please bear with me, and apologies in advance if at first I dont make sense...!
I am doing an undergrad programming project, and need to make some databases within a Java program. I am using eclipse (galilo) to write my program. I have downloaded a connector/J, but havent the foggiest how i should use it!
Anyone out there able to give me a step by step approach?!
Many thanks!
I've used Java for some time and I keep hearing about interfaces such as Cloneable, Iterable and other X-ables.
I was wondering if there is a list somewhere of all of these and more importantly - which ones do you regularly use day-to-day?
For example, I've read that Cloneable is considered badly written and isn't widely used.
Could anyone tell me the difference between library and native library in terms of java? I found the word "native library" in the following line:
Type 1 - drivers that implement the
JDBC API as a mapping to another data
access API, such as ODBC. Drivers of
this type are generally dependent on a
native library, which limits their
portability. The JDBC-ODBC Bridge
driver is an example of a Type 1
driver.
which you can found here
Is there any way to covert from toString back to the object in Java?
For example:
Map<String, String> myMap = new HashMap<String, String>();
myMap.put("value1", "test1");
myMap.put("value2", "test2");
String str = myMap.toString();
Is there any way to convert this String back to the Map?
We have a very strange problem in out application, all of a sudden we started noticing upside down question marks being saved along with other text typed in to the fields on the screen. These upside down question marks were not originally entered by the users and it is unclear where they come from. We are using Oracle 10g with java.
And this is happening, even when no data is copied from Microsoft Word
http://maestric.com/wiki/lib/exe/fetch.php?w=&h=&cache=cache&media=java:spring:spring_mvc.png
In the above image, HTTP request sends something to Dispatcher Servlet. My Question is what does Dispatcher Servlet do.
Is it something like getting the information thrown from the web page and throwing it to the controller.
Hi,
Is there an elegant way in Java to code:
if (10 < x < 20) {
...
}
i.e. "if x is between 10 and 20"
rather than having to write
if ((x > 10) && (x < 20)) {
...
}
Thanks!
Is there a way to print numbers from 1 to 100 without using any loops or conditions like "if"?
We can easily do using recursion but that again has an if condition. Is there a way to do without using "if" as well? Also no repetitive print statements,or a single print statement containing all the numbers from 1 to 100.
A solution in Java is preferable.
I'm creating an email using String Template but when I print out a date, it prints out the full date (eg. Wed Apr 28 10:51:37 BST 2010). I'd like to print it out in the format dd/mm/yyyy but don't know how to format this in the .st file.
I can't modify the date individually (using java's simpleDateFormatter) because I iterate over a collection of objects with dates.
Is there a way to format the date in the .st email template?
In the below example,
class ex8
{
public void show()
{
try
{ int a=10/0; return;}
catch(ArithmeticException e)
{ System.out.println(e); return ;}
finally
{ System.out.println("Finally"); }
}
public static void main(String[] args)
{
new ex8().show();
}
}
the output is:
java.lang.ArithmeticException: / by zero
Finally
How is it that Finally gets printed in spite of return statement in catch?
In Java, which is faster:
Cloning an Object, then passing it to multiple listeners assuming the cloned object contains nothing more complicated than nested arrays, primitives and Strings
Using Streams to pass data through from one object to another?
Guys i have included jstl and standard.jar in lib directory under classpath. It says absolute uri http://java.sun.com/jstl is not found either in web.xml or in application. please let me know how to configure in websphere 5.1.2