CORE API / CATATAN</>↗Core API15 Mei 2009
UUID / GUID (Universally / Globally Unique Identifier) is frequently use in programming. Some of its usage are for creating random file names, session id in web application, transaction id and for record’s primary keys in database replacing the sequence or auto generated number. To generate UUID in Java we can use the java.util.UUID class. […]
JSP / CATATAN</>↗JSP14 Mei 2009
In this post you will learn how to write and read object from HTTP Session in JavaServer Page. The first example that we are looking at is using the classic JSP scriptlet, this is a very old way to work with JSP, but it is good for you to know a history. We write a […]
AWT / CATATAN</>↗AWT11 Mei 2009
MouseInfo provides methods for getting information about the mouse, such as mouse pointer location and the number of mouse buttons. package org.kodejava.awt; import java.awt.*; public class MouseNumberOfButtons { public static void main(String[] args) { // Get the number of buttons on the mouse. On systems without a // mouse, returns -1. HeadlessException if // GraphicsEnvironment.isHeadless() […]
AWT / CATATAN</>↗AWT09 Mei 2009
MouseInfo provides methods for getting information about the mouse, such as mouse pointer location and the number of mouse buttons. package org.kodejava.awt; import java.awt.*; public class MouseInfoDemo { public static void main(String[] args) { int i = 0; while (i < 10) { // Get the location of our mouse x and y coordinate using […]
CORE API / CATATAN</>↗Core API09 Mei 2009
package org.kodejava.lang; public class GetCurrentMethodName { public static void main(String[] args) { // Get the current executing method name String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); System.out.println("methodName = " + methodName); GetCurrentMethodName obj = new GetCurrentMethodName(); obj.executeAMethod(); } private void executeAMethod() { // Get the current executing method name String methodName = Thread.currentThread().getStackTra...
JDBC / CATATAN</>↗JDBC05 Mei 2009
package org.kodejava.jdbc; import java.util.Date; public class UtilDateToSqlDate { public static void main(String[] args) { // Create a new instance of java.util.Date Date date = new Date(); // To covert java.util.Date to java.sql.Date we need to // create an instance of java.sql.Date and pass the long // value of java.util.Date as the parameter. java.sql.Date sqlDate = […]