SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

JDBC / NOTES</>↗
JDBC24 Feb 2007

How do I get column’s precision and scale value?

For instance, you have a number or double typed column in a database table, and you want to get the precision and the scale of that column. Here is an example for you. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; public class ScaleAndPrecisionExample { private static final String […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC23 Feb 2007

How do I know the designated column’s table name?

package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; public class TableNameOfColumnExample { 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 connectio...

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

How do I know if a table column can have a null value or not?

In this example we’ll show how to use ResultSetMetaData.isNullable() method to know if a column can be null or not. This method returns an integer which values defined in the constants of ResultSetMetaData.columnNullable, ResultSetMetaData.columnNoNulls and ResultSetMetaData.columnNullableUnknown. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; imp...

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

How do I know if a table column value is auto-increment?

The ResultSetMetaData.isAutoIncrement() method can tell us if a column value is automatically numbered or not. This method return true when the column is an auto-increment column, otherwise it returns false. See the example below where we check if the first column (id) is an auto-increment column. package org.kodejava.jdbc; import java.sql.*; public class IsAutoIncrementExample { private […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC13 Feb 2007

How do I get column names of a table using ResultSetMetaData?

This example show how we can use the ResultSetMetadata class to get the number of columns and column names of the selected table. The ResultSetMetaData class can also be used to get the column type and its properties. Using the ResultSetMetaData class might help you to create an inquiry program where you don’t have all […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet10 Feb 2007

How do I send a response status in Servlet?

package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebServlet(name = "ResponseStatusServlet", urlPatterns = "/response-status") public class ResponseStatus extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse...

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