java ѹËõͼƬ ʵÀý
public class ImageSizer {
public static final MediaTracker tracker = new MediaTracker(new Component() {
private static final long serialVersionUID = 1234162663955668507L;
});
/**
* ͼƬѹËõ
*
* @param originalFile ÔͼÏñ
* @param resizedFile ѹËõºóµÄͼÏñ
* @param width ͼÏñ¿í
* @param format ͼƬ¸ñʽ jpg, png, gif(·Ç¶¯»)
* @throws IOException
*/
public static void resize(File originalFile, File resizedFile, int width, String format) throws IOException {
if (format != null && "gif".equals(format.toLowerCase())) {
resize(originalFile, resizedFile, width, 1);
return;
}
FileInputStream fis = new FileInputStream(originalFile);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
int readLength = -1;
int bufferSize = 1024;
byte bytes[] = new byte[bufferSize];
while ((readLength = fis.read(bytes, 0, bufferSize)) != -1) {
byteStream.write(bytes, 0, readLength);
}
byte[] in = byteStream.toByteArray();
fis.close();
byteStream.close();
Image inputImage = Toolkit.getDefaultToolkit().createImage(in);
waitForImage(inputImage);
int imageWidth = inputImage.getWidth(null);
if (imageWidth < 1) {
throw new IllegalArgumentException("image width " + imageWidth + " is out of range");
}
int imageHeight = inputImage.getHeight(null);
if (imageHeight < 1) {
throw new IllegalArgumentException("image height " + imageHeight + " is out of range");
}
// Create output image.
int height = -1;
double scaleW = (double) imageWidth / (double) width;
double scaleY = (double) imageHeight / (double) height;
if (scaleW >= 0 && s
Ïà¹ØÎĵµ£º
Õ⼸Ìì¿´ÁËÍøÉÏһЩǰ±²µÄ´úÂ룬×Ô¼º¶ÔJavaʵÏÖzipÎļþµÄ½âѹ£¬Ñ¹ËõÓÐÒ»µãÀí½â£¬¹ÊдÏÂÁô×ÅÒÔºó²Î¿¼¡£
ΪÁË´¦ÀíÖÐÎÄÂÒÂëÎÊÌ⣬ʹÓÃant.jar°ü¡£
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
......
ÄãµÄSQL Server 2000±ØÐë´òÉÏSP3µÄ²¹,È»ºó°²×°MicrosoftµÄJDBCÇý¶¯,½«ÒÔÏÂÈý¸öjar°ü¸´ÖƵ½WebContent\WEB-INF\lib
msbase.jar
mssqlserver.jar
msutil.jar
ÏÂÃæÊDzâÊÔ´úÂ룬ûÓб¨´íÊý¾Ý¿â¾ÍÄÜÕý³£Á¬½Ó
public class DbcTest {
/**
* @param args
*/
public static void main(String[] args) {
Str ......
SqlserverÕâ¶«Î÷ûÉÙ¸úËû´ò½»µÀ,¸Õѧ¿ª·¢ÓïÑÔʱ¾ÍÒѾ¸úËû½Ó´¥ÁË,²»ÒªËµºÜ¾«Í¨,µ«¾ÍÓï·¨»¹ËãÊÇÊìϤ,µ«ÏÖÔÚ¿ªÊ¼Ð´C#,·¢ÏÖºÜC#¶àÁËÒ»ÖÖSqlServerµÄ²ÎÊý´«È뷽ʽ,ÒÔÍùÎÒÃdz£³£¶ÔÒª´«²ÎµÄSqlÓï¾ä¶¼ÊÇÖ±½Óͨ¹ýÆ´´ÕSqlÓï¾äµÄ·½Ê½À´ÊµÏÖ,µ«ÏÖÔÚC#ΪʲôҪרÃÅ×öÒ»¸öSql²ÎÊýµÄÀàÀ´ÊµÏÖÄØ,¾¹ý²éÕÒ²ÅÖªµÀ,ÕâÑù×öÊÇÓеÀÀíµÄ,Ò»Ê ......
´úÂëÄÚÈÝ
create or replace procedure batchUpdateCustomer(p_age in number) as
begin
update CUSTOMERS set AGE=AGE+1 where AGE>p_age;
end;
ÒÔÉÏ´æ´¢¹ý³ÌÓÐÒ»¸ö²ÎÊýp_age£¬´ú±í¿Í»§µÄÄêÁ䣬ӦÓóÌÐò¿É°´ÕÕÒÔÏ·½Ê½µ÷Óô洢¹ý³Ì£º
´úÂëÄÚÈÝ
tx = session.beginTransaction();
Connection con=session.c ......