Skip to main content

Posts

Showing posts with the label File

How to generate excel sheet by using java

Introduction to Excel Generation in Java Java Excel Generation Workflow Java Excel Generation Workflow 1 Determine Export Requirements Identify data structures, formats, and stakeholder reporting needs. 2 Select Appropriate Library Choose Apache POI SXSSF for large modern .xlsx enterprise datasets. 3 Map Data to Grid Coordinates Translate business records into programmatic rows and columns. 4 Configure Memory & Streams Implement disk-backed streaming to prevent OutOfMemoryError exceptions. 5 Export and Stream Output Deliver the styled spreadsheet securely to the client application. Figure: Java Excel Generation Workflow Generating Microsoft Excel documents programmatically is a frequent requirement in enterprise software development. Applications regularly need to export reporting data, financial ledgers, system audit logs, or user rosters into formats that business stakeholders can open, filter, and analyze. While CSV file...

Retrieve File from table by using JDBC with example

Direct Problem Statement JDBC CLOB File Retrieval Architecture JDBC CLOB File Retrieval Architecture 1 Establish JDBC Connection Connect to the MySQL database server using JDBC driver. 2 Execute SQL Query Query the target table to fetch the record containing the CLOB. 3 Extract Clob Object Retrieve the database result field and wrap it as a java.sql.Clob. 4 Stream Character Data Read character stream via buffered readers to prevent JVM OOM errors. 5 Write to Local File Stream the buffer contents safely into a local destination file. Figure: JDBC CLOB File Retrieval Architecture When developing enterprise Java applications, storing configuration files, logs, scripts, or large textual datasets directly inside a relational database management system (RDBMS) is a common architectural pattern. However, relational database rows have strict size limitations for standard string types (such as VARCHAR ). When data payload sizes exceed s...

Store file into table by using JDBC with example

Storing and Retrieving Text Files in MySQL Using JDBC: A Complete Guide Persisting large text files, configuration payloads, or source code documents directly inside a relational database is a common enterprise requirement. When managing structured records alongside unstructured text, relying on character-based large objects prevents the overhead of managing distributed file systems for smaller payloads. This tutorial explains how to map, store, and stream text files into a MySQL database table using Java Database Connectivity (JDBC). ▶ Listen English (India) English (US) Hindi Telugu Tamil Kannada Malayalam Bengali Marathi Gujarati Punjabi Urdu Arabic Spanish French German Portuguese Japanese Korean Chinese (Simplified) Pick a language, then press Listen. For modern containerized environments hosting these relational databases alongside your runtime layers, revie...

Serialization and deserialization in java with examples

Mastering Java Serialization and Deserialization: A Production-Grade Guide Memory in a running Java Virtual Machine (JVM) is volatile. When an application terminates, all objects residing in the heap are permanently lost. Enterprise architectures frequently require object states to persist beyond the lifecycle of a single process—whether for writing state to a disk, caching payloads in distributed memory grids like Redis, or transmitting domain models across a network socket to another service. ▶ Listen English (India) English (US) Hindi Telugu Tamil Kannada Malayalam Bengali Marathi Gujarati Punjabi Urdu Arabic Spanish French German Portuguese Japanese Korean Chinese (Simplified) Pick a language, then press Listen. Hardware and network layers do not understand high-level object graphs, method pointers, or object references. They process raw sequences of bits and ...

Reading properties from a file with example

Essential Java File and Configuration Management: Properties, Directories, and Date Logic Java Properties File Workflow Java Properties File Workflow 1 Externalize Config Store configuration variables in a .properties file. 2 Resource Placement Place property files inside the src/main/resources directory. 3 Define Properties Add key-value pairs like comma-separated role IDs. 4 Load via ClassLoader Read and parse properties at runtime using Java I/O APIs. Figure: Java Properties File Workflow Handling configuration data and interacting with the local file system are fundamental requirements for backend developers. Hardcoding configuration values such as database connection strings, feature toggles, or authorization role IDs inside source code leads to rigid, unmaintainable applications that require recompilation for every environment change. Externalizing these parameters into standard Java .properties files keeps applications modular a...