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.

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
JDBC / NOTES</>↗
JDBC03 Feb 2007

How do I retrieve auto-generated keys?

package org.kodejava.jdbc; import java.sql.*; public class GetGeneratedKeyExample { 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, USERNAME, PASSWORD)) { // The orders table have an ID column which value will be […]

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

How do to commit or rollback transaction in JDBC?

Executing a database manipulation command such as insert, update or delete can sometime throw exception due to invalid data. To protect the integrity of our application data we must make sure that when a transaction fails we must rollback all the executed queries. In this example we are using MySQL database. To enable transaction capability […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet31 Jan 2007

How do I send a cookie in Servlet?

A cookie is a piece of information sent to a browser by a Web Server. The browser then returns that information to the Web server. This is how some Web pages remember your previous visits; for example, an e-commerce website might use a cookie to remember which items you’ve placed in your online shopping cart. […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC27 Jan 2007

How do I create a connection to MS Access database?

The following example show you how to create a connection to Microsoft Access databases. To allow the database access to be authenticated, the security user account can be added from File -> Info -> Users and Permissions screen. Just like accessing any other databases in the Java platform we need a JDBC driver. To access […]

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