java -cp h2-1.3.172.jar org.h2.tools.Script -url [url] -user [user] -password [password]
というような感じでbackup.sqlファイルに内容がダンプされる。パスワードを設定していなければ-passwordは省略する。[url]はjdbc:h2:〜みたいな感じ。
Challange IT For Future
java -cp h2-1.3.172.jar org.h2.tools.Script -url [url] -user [user] -password [password]
というような感じでbackup.sqlファイルに内容がダンプされる。パスワードを設定していなければ-passwordは省略する。[url]はjdbc:h2:〜みたいな感じ。
PDFBoxを使うと、既存のPDFにjpg画像を差し込むことができる。実装例としてはここにあるけど、以下のような感じ。
PDDocument doc = null;
try
{
doc = PDDocument.load( inputFile );
//we will add the image to the first page.
PDPage page = (PDPage)doc.getDocumentCatalog().getAllPages().get( 0 );
PDXObjectImage ximage = null;
if( image.toLowerCase().endsWith( ".jpg" ) )
{
ximage = new PDJpeg(doc, new FileInputStream( image ) );
}
else if (image.toLowerCase().endsWith(".tif") || image.toLowerCase().endsWith(".tiff"))
{
ximage = new PDCcitt(doc, new RandomAccessFile(new File(image),"r"));
}
else
{
//BufferedImage awtImage = ImageIO.read( new File( image ) );
//ximage = new PDPixelMap(doc, awtImage);
throw new IOException( "Image type not supported:" + image );
}
PDPageContentStream contentStream = new PDPageContentStream(doc, page, true, true);
contentStream.drawImage( ximage, 20, 20 );
contentStream.close();
doc.save( outputFile );
}
finally
{
if( doc != null )
{
doc.close();
}
}
ポイントは
かな。