Wednesday, April 1, 2020

Writing a String to a txt file using Java

//Put this at the top of the file:
import java.io.*;
import java.util.*;
BufferedWriter out = new BufferedWriter(new FileWriter("test.txt"));
//Add this to write a string to a file
//
try {

    out
.write("aString\nthis is a\nttest");  //Replace with the string
                                            
//you are trying to write
}
catch (IOException e)
{
   
System.out.println("IO Exception occurred: "+ e);
}
finally
{
    out
.close();
} source: stackoverflow https://stackoverflow.com/questions/10390254/how-do-you-write-a-string-to-a-text-file

Creation of a txt file through JSP

<%@page import="java.io.*"%><%
//File creation
String strPath = "C:\\example.txt";
File strFile = new File(strPath);
boolean fileCreated = strFile.createNewFile();
//File appending
Writer objWriter = new BufferedWriter(new FileWriter(strFile));
objWriter
.write("This is a test");
objWriter
.flush();
objWriter
.close();
%> source: stackoverflow https://stackoverflow.com/questions/5177305/creation-of-a-text-file-in-jsp

Storing txt files in MySQL

Limiting the number of rows a table can have in MySQL

Django in Windows 10

Triggers in MySQL

TRIGGERS in MySQL and other MySQL tutorials https://www.mysqltutorial.org/mysql-triggers/

Types of web hosting: Pros and Cons

What is a superconductor?

 A superconductor is a material that can conduct electricity with zero electrical resistance when it is cooled below a specific, very cold t...