SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JDBC / NOTES</>↗
JDBC03 Feb 2007

How do I retrieve auto-generated keys?

package org.kodejava.jdbc; import java.sql.*; public class GetGeneratedKeyExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; private static final String PASSWORD = "s3cr*t"; public static void main(String[] args) { try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD)) { // The orders table have an ID column which value will be […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC02 Feb 2007

How do to commit or rollback transaction in JDBC?

Executing a database manipulation command such as insert, update or delete can sometime throw exception due to invalid data. To protect the integrity of our application data we must make sure that when a transaction fails we must rollback all the executed queries. In this example we are using MySQL database. To enable transaction capability […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet31 Jan 2007

How do I send a cookie in Servlet?

A cookie is a piece of information sent to a browser by a Web Server. The browser then returns that information to the Web server. This is how some Web pages remember your previous visits; for example, an e-commerce website might use a cookie to remember which items you’ve placed in your online shopping cart. […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC27 Jan 2007

How do I create a connection to MS Access database?

The following example show you how to create a connection to Microsoft Access databases. To allow the database access to be authenticated, the security user account can be added from File -> Info -> Users and Permissions screen. Just like accessing any other databases in the Java platform we need a JDBC driver. To access […]

Wayan · 3 min read
CORE API / NOTES</>↗
Core API23 Jan 2007

How do I calculate process elapsed time?

This example shows us how to use the System.nanoTime() method to get the amount of time a process take place. Please be aware that the nano time value is not related to the real world time value. package org.kodejava.lang; public class ElapsedTimeExample { public static void main(String[] args) { // Get the start time of […]

Wayan · 1 min read
APPLET / NOTES</>↗
Applet20 Jan 2007

How do I create a Hello World Applet?

The code below demonstrate the very basic of Java applet. Applet is a small Java application that can be embedded on the web browser. package org.kodejava.applet; import java.applet.*; import java.awt.*; public class HelloWorldApplet extends Applet { public void init() { } public void start() { } public void stop() { } public void destroy() { […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.