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.

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
SERVLET / NOTES</>↗
Servlet07 Feb 2007

How do I read servlet init parameter?

When creating a servlet we can use the @WebInitParam to define some init parameters in the servlet configuration section (@WebServlet). This init parameter can be used to define where a configuration file of our application is stored, define upload path, etc. This simple servlet below shows how to obtain these init parameters value. package org.kodejava.servlet; […]

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

How do I read cookie in Servlet?

package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; @WebServlet(name = "ReadCookieServlet", urlPatterns = "/read-cookie") public class ReadCookieExample extends HttpServlet { @Override protected vo...

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