Java Code Examples, Tips and Articles

Welcome to Javadb.com


Javadb.com provides source code examples in the Java language as well as other Java specific resources. Feel free to browse through the content or to search for a code example.
Apache Commons
java source code example How to Change the File Date and Time in Java using Commons IO
java source code example Get and Display File Size in a Readable Version using Commons IO
java source code example How to Read File Contents to String using Apache Commons IO

Arrays
java source code example How to Convert an Array to a Collection object
java source code example How to copy an array
java source code example Sorting an Array in Descending (Reverse) Order
java source code example Convert an Array to a List
java source code example Extend the size of an array
View more...

Collections
java source code example Using Generics to Store Specific Type of Objects in a HashMap
java source code example Convert LinkedList to Array
java source code example Convert a List (ArrayList) to an Array
java source code example Using a Set (or HashSet)
java source code example Using a Queue (or LinkedList)
View more...

Compression
java source code example Extract contents of a zip file
java source code example How to list the contents of a zip file
java source code example How to create a zip file

Database
java source code example Connect to database and call stored procedure
java source code example Using a database transaction with JDBC
java source code example Connecting to a Database - Step by Step
java source code example Connect to a database and read from table

Datatype conversions
java source code example Convert byte[ ] array to String
java source code example Convert String to byte array
java source code example Convert String to Boolean
java source code example Convert Boolean to String
java source code example Convert byte to String
View more...

EJB 3
java source code example Lifecycle Callbacks for Stateful Session Beans
java source code example How to create a Stateful Session Bean
java source code example Remote Business Interfaces for Session Beans
java source code example Lifecycle Callbacks for Stateless Session Beans
java source code example Stateless Session Bean

File I/O
java source code example How to Use a FileFilter in Java to List Files
java source code example How to List Files of a Certain Type using a FilenameFilter
java source code example Get file size
java source code example How to Convert a String to an InputStream in Java
java source code example Read Data from InputStream to a String
View more...

Graphics Java 2D
java source code example Drawing a Ractangle with rounded corners using Java 2D Graphics API
java source code example Drawing a Ractangle using Java 2D Graphics API
java source code example Drawing a Line using Java 2D Graphics API
java source code example Drawing a String using Java 2D Graphics API

Java Language Fundamentals
java source code example How to Format a Number in Java
java source code example The Java Keywords
java source code example How to Compare Strings in Java
java source code example Measure Time in Nano-Seconds
java source code example Using Varargs in Java
View more...

JMS
java source code example Creating a TopicConnectionFactory

JPA, Java Persistence API
java source code example A Simple Java Persistence API Entity

Networking
java source code example Sending a POST Request with Parameters From a Java Class
java source code example Downloading a web page using URL and URLConnection classes
java source code example Perform NSLookup with the InetAddress class

Reflection
java source code example Instantiate unknown class at runtime and call the object's methods
java source code example List methods of a class using Reflection
java source code example Invoke methods of an object using reflection

Servlets
java source code example Redirect Servlet Call to Another URL
java source code example Forward Call from a Servlet
java source code example Get Users IP Address
java source code example Get and Set Session Variables in a Servlet
java source code example Get Request Parameters in a Servlet

Small programs
java source code example The Tic Tac Toe Game in Java Code
java source code example Pretty Print SOAP Message and Display the SOAP message in HTML
java source code example Weight Converter, Pound to Kilogram, Ounce to Kilogram
java source code example Java Source Code for The HiLo Game
java source code example How to find and calculate prime numbers

Swing
java source code example Show a message dialog with JOptionPane
java source code example Set Look and Feel for a Swing application
java source code example JLabel with more than one row

Threads
java source code example Setting thread priorities
java source code example How to create a thread

Utility Classes
java source code example How to Compute the Difference Between Two Dates in Java
java source code example Using the StringTokenizer to Split a String
java source code example How to get the Current Week using the Calendar class
java source code example How to get the Current Time in Milliseconds using either Date or Calendar classes
java source code example Get the current TimeZone using the Calendar class
View more...

Web Services
java source code example Using a Message Handler to alter the SOAP Header in a Web Service Client
java source code example Create a Web Service Client with JAX-WS
java source code example Create a simple Web Service


Tutorials
java source code example Java Language Tutorial


Bookmark and Share




Need help with your Java code? It's secure and confidential.
This is how it works:
Send a detailed description of what you need help with, the more details the better. Also provide a deadline for when it has to be finished. More time means better chance of putting your request into the schedule.

If the request is serious you will shortly receive an email with the price, to which you have to respond if you accept.

Once you have accepted, the work will begin on developing your code by an experienced Java developer. When the code is finished a link to a secure payment will be sent to you.

The source code is then sent to you once the payment is completed.

IMPORTANT! The request needs to be very detailed, else it may be ignored.


Write your detailed request here:

E-mail address: