background preloader

Java

Facebook Twitter

Write a program to get a line with max word count from the given file. - Java Interview Programs.

Nts.edu

Design pattern in simple examples. An introduction to Maven 2. Maven is a popular open source build tool for enterprise Java projects, designed to take much of the hard work out of the build process.

An introduction to Maven 2

Maven uses a declarative approach, where the project structure and contents are described, rather then the task-based approach used in Ant or in traditional make files, for example. This helps enforce company-wide development standards and reduces the time needed to write and maintain build scripts. The declarative, lifecycle-based approach used by Maven 1 is, for many, a radical departure from more traditional build techniques, and Maven 2 goes even further in this regard. In this article, I go through some of the basic principals behind Maven 2 and then step through a working example. Let's start by reviewing the fundamentals of Maven 2. The project object model The heart of a Maven 2 project is the project object model (or POM for short). <project xmlns=" xmlns:xsi=" xsi:schemaLocation=" Quick Start Archetype</name><url> Java with curl ( Hi, Looking at all the cases/possibilities, i have opted to do this using httpclient or urlconnection class.

Java with curl (

I have not written the complete code but have just manage to write which would get us started atleast.. If I had used curl - I would have to write the following. view plainprint? Curl -u username:password -d "param1=aaa& param2=bbb" -k http: curl -u username:password -d "param1=aaa& param2=bbb" -k this would have returned me an output in XML.

Login to eBay with Java cURL. Lately, I played around with the eBay API using the Java SDK.

Login to eBay with Java cURL

It was quite easy to use but when it comes to use your application in production using the real eBay site (not the sandbox), you need to be certified. And It has a bunch of conditions that my application wasn't fulfilling. A work around is simply not to use the eBay API and to programmatically simulate a real user connecting to eBay through the web interface and place bids as you would through your browser.

Using cURL for Testing Web Applications « Brain Flush. This may be old news to some, but although I had heard of using cURL for downloading files off the internet from a command line (as a wget alternative), I didn’t know that it was actually capable of doing much, much more.

Using cURL for Testing Web Applications « Brain Flush

In fact, cURL is a very good allrounder at doing anything related to transmitting and receiving data using popular protocols such as HTTP(S), (S)FTP, TELNET, LDAP and more. In particular, you can use it to test your Web application with very little effort! I am currently programming for a Java Servlet based Web application, where I need to assemble HTTP requests on the client side and dissect them on the server side. More precisely, I have a servlet which extracts data from an HTTP multipart request (using Apache Commons FileUpload) and hand it over to the logic for further processing. Of course, I have to write lots of code for checking whether requests are valid and so forth.

Collections

How do I retrieve the values of a Hashtable/HashMap in sorted order? The JDBC API (Java Servlet Programming) Previously, we've assumed that you have a general working knowledge of the various Java APIs.

The JDBC API (Java Servlet Programming)

Because even experienced Java programmers may have had relatively little experience with databases, this section provides a general introduction to JDBC. If this is your first foray into the world of databases, we strongly recommend that you take a breather and find a book on general database and JDBC concepts. You may want to read Database Programming with JDBC and Java, by George Reese (O'Reilly), orJDBC Database Access with Java, by Graham Hamilton, Rick Cattell, and Maydene Fisher (Addison-Wesley).

The official JDBC specification is also available online at JDBC is a SQL-level API--one that allows you to execute SQL statements and retrieve the results, if any. Figure 9-2. 9.2.1. The JDBC API, found in the java.sql package, contains only a few concrete classes.

Java code search

Regular Expressions. Java provides the java.util.regex package for pattern matching with regular expressions.

Regular Expressions

Java regular expressions are very similar to the Perl programming language and very easy to learn. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. They can be used to search, edit, or manipulate text and data. The java.util.regex package primarily consists of the following three classes: Java Exception Handling Tutorial. Java exception handling enables your Java applications to handle errors sensibly.

Java Exception Handling Tutorial

Exception handling is a very important yet often neglected aspect of writing robust Java applications or components. When an error occurs in a Java program it usually results in an exception being thrown. How you throw, catch and handle these exception matters. There are several different ways to do so. Not all are equally efficient and fail safe. Design pattern in simple examples.

Java annotations

CSV Reader.