JavaÖжÁÈ¡propertiesÎļþµÄ¼¸ÖÖ·½·¨
¡¡1¡¢Ê¹ÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨
ʾÀý£º
String name = "logging"; // the logging.properties file in src root folder
ResourceBundle rb = ResourceBundle.getBundle(name,Locale.getDefault());
// test the rb
String propertyKey = "xxx";
System.out.println(rb.getString(propertyKey));
¡¡2¡¢Ê¹ÓÃjava.util.PropertyResourceBundleÀàµÄ¹¹Ôì·½·¨
ʾÀý£º
String fileName = "src/logging.properties"; // the file path
InputStream in = new FileInputStream(fileName));
ResourceBundle rb = new PropertyResourceBundle(in);
// test the rb
String propertyKey = "xxx";
System.out.println(rb.getString(propertyKey));
¡¡3¡¢Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨
ʾÀý£º
String fileName = "src/logging.properties"; // the file path
InputStream in = new FileInputStream(fileName));
Properties prop = new Properties();
prop.load(in);
// test the prop
String propertyKey = "xxx";
System.out.println(prop.getProperty(propertyKey));
¡¡4¡¢Ê¹ÓÃclass±äÁ¿µÄgetResourceAsStream()·½·¨
ʾÀý£º
InputStream in = Properties.class.getResourceAsStream(name);
Properties p = new Properties();
p.load(in);
¡¡5¡¢Ê¹ÓÃclass.getClassLoader()ËùµÃµ½µÄjava.lang.ClassLoaderµÄgetResourceAsStream()·½·¨
ʾÀý£º
InputStream in = Properties.class.getClassLoader().getResourceAsStream(name);
Properties p = new Properties();
p.load(in);
¡¡6¡¢Ê¹ÓÃjava.lang.ClassLoaderÀàµÄgetSystemResourceAsStream()¾²Ì¬·½·¨
ʾÀý£º
InputStream in = ClassLoader.getSystemResourceAsStream(name);
Properties p = new Properties();
p.load(in);
¡¡7¡¢ServletÖпÉÒÔʹÓÃjavax.servlet.ServletContextµÄgetResourceAsStream()·½·¨
ʾÀý£º
InputStream in = context.getResourceAsStream(path);
Properties p = new Properties();
p.load(in);
Ïà¹ØÎĵµ£º
¿ÉÒÔ°ÑÆÕͨµÄJava³ÌÐò×ö³ÉÕæÕýµÄexe,Ò²¾ÍÊǵ¥Ò»¸öexe¾Í¿ÉÒÔÔÚûÓа²×°JVMµÄ»úÆ÷ÉÏÔËÐС£ÕâÑùµÄ¹¤¾ß³£¼ûµÄÓÐJETºÍgcj.ǰÕßÊÇÊշѵ쬶øÇÒ×ö³öÀ´µÄexe»¹ÊÇÐèÒªÒ»¶Ñdll¡£ÍƼöʹÓÃgcj.ËûÓÐwindowsºÍLinux°æ£¬Ö±½ÓÏÂÔØzip°ü£¬²»ÐèÒª°²×°£¬ÀïÃæÓв»ÉÙÀý×Ó£¬Ò»Ð©buildµÄÅú´¦ÀíÎļþ¡£´ÓÔÀíÀ´Ëµgcj×Ô¼ºÊµÏÖÁËJVM¹æ·¶£¬Ò²¾ÍÊÇÄ ......
Javaµ÷Óô洢¹ý³Ì
±¾ÎIJûÊöÁËÔõôʹÓÃDBMS´æ´¢¹ý³Ì¡£ÎÒ²ûÊöÁËʹÓô洢¹ý³ÌµÄ»ù±¾µÄºÍ¸ß¼¶ÌØÐÔ£¬±ÈÈç·µ»ØResultSet¡£±¾ÎļÙÉèÄã¶ÔDBMSºÍJDBCÒѾ·Ç³£ÊìϤ£¬Ò²¼ÙÉèÄãÄܹ»ºÁÎÞÕϰµØÔĶÁÆäËüÓïÑÔд³ÉµÄ´úÂ루¼´²»ÊÇJavaµÄÓïÑÔ£©£¬µ«ÊÇ£¬²¢²»ÒªÇóÄãÓÐÈκδ洢¹ý³ÌµÄ±à³Ì¾Àú¡£
´æ´¢¹ý³ÌÊÇÖ¸±£´æÔÚ ......
ÔÚ¡¶JDBC Driver For SQL2000/2005/2008
¡·Ò»ÎÄÖУ¬ÑûÔ½éÉÜÁËÈçºÎÏÂÔØ²¢Ê¹ÓÃjdbcÁ¬½ÓSQL Server,
½ñÌìÓÐÈËÎÊÆð£¬ÈçºÎÒÔwindows¼¯³É·½Ê½Á¬½ÓSQL Server,Õâ¸öÒÔÇ°ÕæÃ»ÊÔ¹ý¡£
ÓÚÊÇ£¬´ò¿ªnetBeans²âÊÔÁËһϣ¬´úÂëÈçÏ£º
/*
* To change this template, choose Tools | Templates
* and open the template in the edit ......
1.¸ÅÊö
JSPÊÇÒ»ÖÖʵÏÖÆÕͨ¾²Ì¬HTMLºÍ¶¯Ì¬HTML»ìºÏ±àÂëµÄ¼¼Êõ¡£
JSP×îÖջᱻת»»³É±ê×¼µÄServlet£¡£¡£¡
JSPÉè¼ÆµÄÄ¿µÄÔÚÓÚ¼ò»¯±íʾ²ãµÄ±íʾ¡£
JSPÒ³ÃæµÄÆäËû³É·ÖÖ÷ÒªÓÐÈçÏÂÈýÖÖ£º
½Å±¾ÔªËØ
Ö¸Áî
¶¯×÷
ÀýÈ磺
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*& ......