User Tools

Site Tools


java:index

Apuntes de Java

About software tools to synchronize with subversion

2013/03/22 update: I've tried subversion in a Windows machine and I found out that it doesn't work because it requires a connector and the instructions to download the connector are not easily found. I recognize that I gave up at first difficulty, but talking about plugins, I don't give them many opportunities. Moreover, I found that the subclipse plugin has more popularity.

I have a 64 bit laptop –Intel–. I usually develop java in there. I found that the subclipse plugin for subversion crashes frequently, but the Subversive doesn't. For anyone that may be interested.

And by the way, if you are planning to download something from sourceforge, choose SVN Kit 1.3.2 connector compatible with version 1.6.x of subversion. See this: http://sourceforge.net/scm/?type=svn&group_id=80882.

Configure a C3P0 datasource in spring

Launching a java batch file from a visual basic script

'
' sisyphus.vbs
'
 
 
dim osh 
dim classpath
 
classpath="./;./CopyTables.jar;./lib/*"
 
set osh = createobject("wScript.shell") 
 
' get the variables of the "process" environment
set objEnv = osh.Environment("Process")
 
objEnv("CLASSPATH") = classpath
 
osh.run "java App -Dorg.apache.commons.logging.Log=log4j.properties >> console.log 2>>error.log",1

Formatear fechas y números

Un ejemplo de tres formateadores: uno para fechas, otro para horas, y otro para números. Estos formateadores van a usar los formatos “a capón” en lugar de usar los que provee por defecto Locale, que debería ser la forma correcta de usarlos para que la aplicación fuese internacionalizable.

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.Locale;
 
SimpleDateFormat formatDate = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat formatDateFecharea = new SimpleDateFormat("yyyyMMdd");
 
SimpleDateFormat formatTime = new SimpleDateFormat("HH:mm");
DecimalFormat formatNumber = new DecimalFormat("#,###.##");
 
DecimalFormatSymbols symbols2 = new DecimalFormatSymbols(Locale.US);
DecimalFormat formatNumberUS = new DecimalFormat("#,###.##", symbols2 );

Parsing a Date in Java

try {
    // Some examples
    DateFormat formatter = new SimpleDateFormat("MM/dd/yy");
    Date date = (Date)formatter.parse("01/29/02");
 
    formatter = new SimpleDateFormat("dd-MMM-yy");
    date = (Date)formatter.parse("29-Jan-02");
 
    // Parse a date and time; see also
    // Parsing the Time Using a Custom Format
    formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
    date = (Date)formatter.parse("2002.01.29.08.36.33");
 
    formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z");
    date = (Date)formatter.parse("Tue, 29 Jan 2002 22:14:02 -0500");
} catch (ParseException e) {
}

Example taken from http://exampledepot.com/egs/java.text/ParseDate.html.

Recursos Java

Java básico

J2EE

API's de Java

Hay dos: una es la de la “Standard Edition”, que contiene lo más básico:

http://java.sun.com/javase/6/docs/api/

Y la otra es la “Enterprise Edition” que contiene paquetes y clases para el desarrollo de aplicaciones web, servicios y programación con xml:

http://java.sun.com/javaee/5/docs/api/

Java for Mobile Devices

Online Training

Lista de charset, para cuando nos soliciten un parámetro "charset"

java/index.txt · Last modified: 2016/05/09 19:36 by rlunaro