Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

JDBC / CATATAN</>
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 menit baca
JDBC / CATATAN</>
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 menit baca
JDBC / CATATAN</>
JDBC06 Mar 2007

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

When iterating the scrollable result-sets, you can check whether you are in the beginning of the result set or not. The isBeforFirst() method check if the position is at the beginning, if yes this method returns true, otherwise it will return false. 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 […]

Wayan · 2 menit baca
JDBC / CATATAN</>
JDBC01 Mar 2007

How do I move a cursor to the last record?

To move the cursor to the end of result-set (after the last record), you can call the afterLast() method of the ResultSet. 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 = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; private static final […]

Wayan · 2 menit baca
JDBC / CATATAN</>
JDBC01 Mar 2007

How do I move a cursor in scrollable ResultSet?

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 ScrollableMoveExample { 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, U...

Wayan · 2 menit baca
JDBC / CATATAN</>
JDBC25 Feb 2007

How do I use DatabaseMetaData to get table column names?

In this example, we are using the DatabaseMetaData to retrieve table’s column names. The metadata information can be obtained by calling the connection.getMetaData(). Next, we can then get a ResultSet object by calling metadata.getColumns() method and passing the catalog name, schema pattern, table name pattern, and column name pattern. From this result set COLUMN_NAME, TYPE_NAME, […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.