JDBC / CATATAN</>↗JDBC18 Feb 2008
A database transaction in any relational database management system (RDBMS) is a sequence of one or more SQL operations that are executed as a single unit of work. The primary characteristics and properties of transactions are encapsulated in the ACID principles: Atomicity: Ensures that all operations within the transaction are completed successfully. If any operation […]
JDBC / CATATAN</>↗JDBC15 Feb 2008
The code below helps you to get some product information about the database that you use in creating your program. You can retrieve database information such as the major and minor version of the product, the database product name and its release version. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.DatabaseMetaData; import java.sql.SQLException; public class […]
JDBC / CATATAN</>↗JDBC13 Feb 2008
JDBC stands for Java Database Connectivity. It is an API (Application Programming Interface) in Java that allows Java applications to interact with databases. JDBC provides a set of interfaces and classes for connecting to a database, executing SQL queries, and retrieving results. It is part of the Java Standard Edition platform and is designed to […]
CORE API / CATATAN</>↗Core API09 Feb 2008
package org.kodejava.util; import java.util.Currency; import java.util.Locale; public class CurrencySymbol { public static void main(String[] args) { Currency currency = Currency.getInstance(Locale.JAPAN); System.out.println("Japan = " + currency.getSymbol()); currency = Currency.getInstance(Locale.UK); System.out.println("UK = " + currency.getSymbol()); currency = Currency.getInstance(Locale.US); System.out.println("US = " + currency.getSymbol()); currency = Currency.getInst...
AWT / CATATAN</>↗AWT06 Feb 2008
In this example we are automating the process of creating mouse event using the java.awt.Robot class. package org.kodejava.awt; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.InputEvent; public class MovingMouseDemo { public static void main(String[] args) { try { Robot robot = new Robot(); // Move mouse cursor to 200, 500 robot.mouseMove(200, 500); // Press the mouse button […]
AWT / CATATAN</>↗AWT05 Feb 2008
The example here show us how to get the color of a pixel in the screen. We use the Robot.getPixelColor(int x, int y) method to obtain the Color of the pixel. package org.kodejava.awt; import java.awt.Color; import java.awt.Robot; import java.awt.AWTException; public class ColorPickerDemo { public static void main(String[] args) { try { Robot robot = new […]