博文

目前显示的是 五月, 2013的博文

connect to a database

see: Help! I can’t connect to my database see: Help! I can’t connect to my database (part duex)  At Client machine: tnsnames.ora, sqlnet.ora TNS locates its configuration file (sqlnet.ora) and name resolution file (tnsnames.ora) are on a Windows client.  This tnsnames.ora file must be found on the client machine.  By default it will be found in $ORACLE_HOME/network/admin. At Server machine/ on the server : listener.ora The listener is very simple.  It runs on the server (not the client) and it’s job is to listen for connection requests and make the connection (server process) between the client and the database instance.  Once that connection is made, the listener is out of the picture. If you were to kill the listener, all existing connections would continue. “localhost” or “127.0.01″ is a NONROUTABLE ip address. There are two parameters, GLOBAL_DBNAME and SID_NAME in listener.ora.  The GLOBAL_DBNAME is Service name for ...

jar/war/ear

jar:  Java   Archive   file ;  war: Web   Archive   file;  ear: Enterprise   Archive   file; Their file format are .zip or .jar that is an archive file format that supports loss-less data compression. JAR : Software developers generally use .jar files to distribute Java applications or libraries, in the form. of classes and associated metadata and resources (text, images, etc.) JAR files build on the ZIP file format. WAR : In computing, a WAR file (which stands for "web application archive" ) is a JAR file used to distribute a collection of JavaServer Pages, servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application. EAR : An Enterprise ARchive, or EAR, is a file format used by Java EE for packaging one or more modules into a single archive so that the deployment of the various modules onto an application server happens simu...

Ojbect Serializable Collections.reverseOrder

For playing, thanks http://yfain.github.io/Java4Kids/#_writing_into_a_file. import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.time.LocalDateTime; import java.util.*; public class ScoreManager {     public static void main(String[] args){         List<Score> scores = new ArrayList<>();         Path path = Paths.get("scores.ser");         if (Files.exists(path)) {             scores = loadScores(path);         } else {             scores = new ArrayList<>();         }     ...