background preloader

SLF4J

SLF4J
Related:  JAVA

jpcap network packet capture library Network Packet Capture Facility for Java | Free software downloads kaitoy/pcap4j Retrieve Oracle version information This Oracle tutorial explains how to find the Oracle version information with syntax and examples. Description You can check the Oracle version by running a query from the command prompt. The version information is stored in a table called v$version. In this table you can find the version information for Oracle, PL/SQL, etc. Syntax The syntax to retrieve the Oracle version information is: SELECT * FROM v$version; SELECT * FROM v$version WHERE banner LIKE 'Oracle%'; Parameters or Arguments There are no parameters or arguments. Example Let's look at some of examples of how to retrieve version information from Oracle. All Version Information To retrieve all version information from Oracle, you could execute the following SQL statement: This query would output something like this: Oracle Version Only If you only wanted the Oracle version information, you execute the following SQL statement: It should return something like this:

Programación con Java: 10 de las Mejores Prácticas en Java 1.- Evitar la creación innecesaria de objetos, Lazy Initialitation La creación de objetos en Java es una de las operaciones mas costosas en términos de uso de memoria e impacto en el performance. Esto es evitable creando o inicializando objetos solo en el momento en que serán requeridos en el código. public class Paises { private List paises; public List getPaises() { //se inicializa solo cuando es requerido if(null == paises) { paises = new ArrayList(); } return paises; } } 2.- Nunca hacer variables de instancia públicas Hacer una clase publica se puede ocasionar problemas en un programa. public class MiCalendario { public String[] diasDeLaSemana = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"}; //mas código } La mejor práctica es como mucho de ustedes saben, es siempre definir estas variables como privadas y crear los métodos accesores, “setters“ y “getters” Pero escribir los métodos accesores no resuelve el problema del todo. Escribir código es divertido.

Buenas prácticas para la construcción de software Java Weak Reference Releasing unused objects for garbage collection can be done efficiently using java weak reference. Yes. weak reference is related to garbage collection. In java we need to not anything explicitly for garbage collection (GC), this memory management overhead is taken care by java run-time itself. Then what is the use of java weak reference? Let us see an example scenario, which will help us understand the problem in detail. Before that, we should be aware there are four types of references in java and they are strong reference, weak reference, soft reference and phantom reference. Weak Reference When there are one or more reference to an object it will not be garbage collected in Java. Let us take a sample scenario to understand it better. Key is TextView object and value is the Id. So, programmatic we need to ensure that, when a textView is removed then its corresponding entry in the map should be removed. WeakHashMap There is a predefined Map which uses weak reference. Soft Reference

Play framework - Home Design Patterns in Java Tutorial Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time. This tutorial will take you through step by step approach and examples using Java while learning Design Pattern concepts. This reference has been prepared for the experienced developers to provide best solutions to certain problems faced during software development and for un-experienced developers to learn software design in an easy and faster way. Before you start proceeding with this tutorial, I'm making an assumption that you are already aware about basic java programming concepts.

Java concurrency (multi-threading) - tutorial Asynchronous task handling is important for any application which performs time consuming activities, as IO operations. Two basic approaches to asynchronous task handling are available to a Java application: application logic blocks until a task completesapplication logic is called once the task completes, this is called a nonblocking approach. CompletableFuture extends the functionality of the Future interface for asynchronous calls. It adds standard techniques for executing application code when a task completes, including various ways to combine tasks. This callback can be executed in another thread as the thread in which the CompletableFuture is executed. The following example demonstrates how to create a basic CompletableFuture. CompletableFuture.supplyAsync(this::doSomething); CompletableFuture.supplyAsync runs the task asynchronously on the default thread pool of Java. The usage of the thenApply method is demonstrated by the following code snippet.

Upgrade from Tiles 2 to Tiles 3 on Spring MVC 3 application | Codingpedia.org I’ve just upgraded the web application that powers Podcastpedia.org to use Apache Tiles 3 instead of Tiles 2. I am particularly interested in the Tiles integration with Velocity for email generation. Note: You need at least the Spring 3.2 release for this to work. This occured in three small steps: upgrade maven dependenciesupgrade tiles elements in the Spring application contextupgrade tiles dtd version 1. What I had to do was just replace the ${tiles.version} in the maven pom.xml file from 2.2.2 to 3.0.1 for the Tiles dependencies I use, and now it looks like this: 2. The next thing was to upgrade to version 3 the tilesViewResolver and tilesConfigurer in the Spring application context: Tiles configuration in the Spring application context .................... <! 3. In the Tiles definitions templates upgrade to Tiles 3.0 dtd <? That’s it. P.S.

Clases de Utilidad Java VII: Reflection | Un poco de Java Bueno, pues vamos a avanzar un poco más en nuestras clases de utilidad y hoy vamos a poner unos cuantos métodos con los que poder usar el API reflection. Éste API es muy usado dentro de la comunidad y es una herramienta muy potente a la hora de invocar métodos o clases por ejemplo definidos en base de datos. Obtener una clase a partir de un nombre: * Obtiene una clase a partir del nombre de la misma. * @param clazz La cadena que identifica la clase que se quiere obtener. * @return La clase correspondiente si se ha encontrado, y sino una excepción PLNException. * @throws La excepción Exception. @SuppressWarnings("unchecked") public static Class getClass (String clazz) throws Exception { Class result = null; try { result = Class.forName(clazz); } catch (ClassNotFoundException e) { log.error("No se encuentra la clase " + clazz, e); throw new Exception("No se encuentra la clase " + clazz,e); } catch (NullPointerException e) { log.error("Se ha pasado un nombre de clase null ", e); return result; int i = 0;

Logging facade that allows various implementations to be used like log4j, java logging, commons logging. The chap that made this library has his own logging framework that is supported( by superunknown Apr 10

Related: