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.

APPLET / NOTES</>↗
Applet22 Mar 2007

How do I read an applet parameters?

package org.kodejava.applet; import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class AppletParameterExample extends Applet { private String name = ""; public void init() { // Here we read a parameter named name from the applet tag definition // in our html file. name = getParameter("name"); } public void paint(Graphics g) { g.setColor(Color.BLUE); g.drawString("Hello " + name […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API19 Mar 2007

How do I convert string date to long value?

package org.kodejava.util; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class StringDateToLong { public static void main(String[] args) { // Here we have a string date, and we want to covert it to long value String today = "25/09/2021"; // Create a SimpleDateFormat which will be used to convert the string to // a […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC19 Mar 2007

How do I create a scrollable result sets?

Since JDBC 2.0 (JDK 1.2), a scrollable ResultSet was introduced to the java.sql API family. Using this ResultSet enables us to navigate the result set in forward or backward way. To enable the scrollable ResultSet, we need to create a statement object by defining the ResultSet type (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.TYPE_SCROLL_INSENSITIVE). If you define the ResultSet type […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC15 Mar 2007

How do I move to absolute or relative row?

In this example we are showing you how to use result set absolute() and relative() method to jump from one result set row to the other. When you pass a positive number as the parameter, you’ll move from the first record to the last. But if you pass a negative number as parameter, you’ll move […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC12 Mar 2007

How do I know the current position of cursor?

Moving through the result set, you might want to know in what row is the current cursor positioned. To get this information, you can call the ResultSet’s getRow() method. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class ScrollableGetRowExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC08 Mar 2007

How do I check if a cursor is in the last row?

On the previous example, we check for the beginning of the result-set. Now using the isAfterLast() method we can check the opposite whether the pointer is at the end of the result set. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class ScrollableAfterLastExample { private static final String URL = […]

Wayan · 2 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.