1: JDK Development System Environment Variable Settings: Methods: WIN2000: Right-click My Computer - "Properties -" Advanced - "Environment Variable ClassPath = .; JDK Installer / libpath = JDK Installation Directory / bin : It must not be ignored ".". Win98: Modifying AutoCexe.bat is to modify the automatic batch file. Add: set classpath = .; JDK installation / libset path = jdk installation directory / bin;% PATH% 2: (premise settings system environment variable) Do not bring compilation, quite simple: Javac class name .javajava class name About the compilation problem of bag: If your class is packaged, you should compile: Javac -d packets of the parent class name. Javajava package name. Class name 3: Tomcat server configuration: 1): Set the system Environment variable. 2): java_home = g: /jbuilder6/jdk1.3.1 g: /jbuilder6/jdk1.3.1 is a JDK installation directory 3): Tomcat_Home = Tomcat installation directory 4: Modify the Serlet without restart Tomcat modification% Tomcat_Home% / conf / server .xml is approximately as follows:
6: Configure JBuilder6 WebShpere4.0ae, in fact, JB7 can refer to: first install J2EE, then add J2EE to the JB of Libraries. The method is as follows 1 :) Tools ---> configure libraries -> new ---> name: Fill in J2EE, location: The default is old. ----> Add -> Select the J2EE installation path, select the lib folder - OK - OK. 2 Return to Configure Libraries, select Required Libraries -> Add - "Select your original creation. J2EE, point OK is OK. Then configure the WebShpere application server and Database Pilot: The first step: Tools -> Enterprise Setup -> Application Servers Set the installation path and the IBM's Java path, DB2 you look at your second step: Project -> Defaults Project Properties Servers Select WS4.0 and should be able to use WebShpere4.0 does not support EJB2.0, WebShpere5.0 support. Configuring Database Pilot Step 1: Add Category Library Tools -> Config Libraries Add Your Database Driver Table 2: Tools -> Enterprise Setup -> Database Drivers Add the class library you just added to the third step : After restarting JBilder, Tools -> DATABASE PILOT -> Option -> Drivers, add driver Step 4: New construction in Database Pilot Point, Driver: com.ibm.db2.jdbc.app.db2driver. URL: JDBC: DB2: DB_SDBC. (DB_SDBC is a DB2 database on the server). [Post Reply] [View cu forum original] [Close]
Eclipse Reply to: 2002-10-07 23: 26: 157: Solve Java Chinese Problem: For Applet and AWT: 1 :) font f = new font (uiResource.getstring ("default_font", font.plain, 12); UIManager .put ("label.font", f); uimanager.put ("label.Foreground", Color.Black); UIManager.put ("Button.Font", F); UIManager.put ("menu.font", f); UIManager.Put ("MenuItem.Font", F); UIManager.put ("List.Font", F); UIManager.Put ("Checkbox.Font", F); UIManager.put ("Radiobutton.Font ", f); uimanager.put (" combobox.font ", f); uimanager.put (" textarea.font ", f); 2 :) font f = new font (" Lishu ", Font.Plain, 15) UIManager.put ("Button.Font", Font); UIManager.put ("ToggleButton.font", Font); UIManager.put ("Radiobutton.Font", Font); UIManager.put ("Checkbox.Font", UIManager.put ("colorchooser.font", font; uimanager.put ("ToggleButton.font", font); UIManager.put ("ComboBox.Font", font); UIManager.put ("ComboBoxItem.font ", font); UIManager.put (" INTERNALFRAME.TILEFONT ", FONT); UIManager.put (" label.font ", font); UIManager.put ("list.font", font); uimanager.put ("menubar.font", font); UIManager.put ("menu.font", font); UIManager.put ("MenuItem.Font", Font UIManager.Put ("RadiobuttonMenuItem.font", font); UIManager.Put ("CheckBoxMenuItem.font", font); UIManager.put ("Popupmenu.Font", font); UIManager.put ("optionpane.font" , font; uimanager.put ("panel.font", font); UIManager.put ("progressbar.font", font); uimanager.put ("scrollpane.font"
, font; uimanager.put; uimanager.put ("tabbedpane.font", font); UIManager.put ("TableHeader.Font", font); UIManager.put ("TextField.Font" , font); UIManager.Put ("PasswordFiled.font", Font); UIManager.Put ("TextArea.font", font); UIManager.Put ("TextPane.Font", Font); UIManager.Put ("EditorPane. Font ", font); UIManager.put (" Titledborder.font ", Font); UIManager.put (" Toolbar.Font ", Font); UIManager.put (" Tooltip.Font ", Font); UIManager.put (" Tree.Font ", font); 3 :) For JSP and Servlet: Solution: First: Add: <% @ Page ContentType =" Text / HTML; Charset = GB2312 "%> or in servlet PUBLIC VOID doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {response.setContentType ( "text / html; charset = gb2312"; // this is important not just in the above, if called before the data storage using the following method : Public Static String UnicoDetoChinese (String S) {if (s == Null || S.Equals (") Return"; string newstring = null; newstring = new string (S.GetBytes ("ISO8859_1", " GB2312 "; return newstring;} catch (unsupportedenc ODINGEXCEPTION E) {RETURN S;}} public static string chinesetounicode (string s) {type {if (s == null || s.equals (") return"; string newstring = null; newstring = new string (s .getbytes ("GB2312", "ISO8859_1"; Return newstring;} catch (unsupportedEncodingException e) {return s;}} 3 Solving WebLogic / WebShpere Chinese issues: In the web.xml file, you need to configure the Chinese environment.
R As:
= '") {RETURN CDIS [0] .substring (POS 6, CDIS [0] .length () - 1);} return cdis [0] .substring (POS 5, CDIS [0] .ley" ));}} 8: String: public int getcount (string str, string Sign) {// Find the number of STRs in a string, a specific substrings S, the number of occurrences of a specific substring S, Return 0; StringTokenizer s = new StringTokenizer (STR, SIGN); Return S.countToKens ();} public string [] getArray (String Str, String Sign) {// is marked by a specific substring S, and the sub-string is intermediary. Int Count = getCount (STR, SIGN); int J = 0; string [] arr = new string [count]; for (int i = 0; i 1.3 solve a problem as follows: public String stringReplace (String sourceString, String toReplaceString, String replaceString) {String returnString = sourceString; int stringLength = 0; if (toReplaceString = null!) {StringLength = toReplaceString.length () } If (returnstring! = Null && returnstring.LENGTH ()> StringLength) {int max = 0; string s4 = ""; for (int i = 0; i Eclipse Reply to: 2002-10-07 23: 26: 5210: Digital Transfer Currency (JS) Function Changetobig (Value) {Var Intfen, I; Var Strarr, Strnum, Strfen, Strdw, Strnum, Strbig, Strnow; IF Trim (value) == "" // data returns "zero" Return "zero" 非 (ISNAN (Value) // data illegal prompt, and return the empty string {strerr = "data" value " Illegal! "Alert (strerr); Return" ";} strCheck = value "; strr = strcheck.split ("."; StrCheck = strrr [0]; if (strCheck.length> 12) // data is greater than equals One trillions When prompted to handle {strerr = "data" value "excessively, unable to handle!" Alert (strr); return ";} try {i = 0; strbig ="; "; intfen = value * 100; // Convert to a value string Strfen = intfen.tostring (); strr = strfen.split ("."; Strfen = strarr [0]; intfen = strfen.length; // Get length strr = strfen.split (""; // Decompose each value into the While (INTFEN! = 0) // Decompose and convert {i = i 1; switch (i) // selection unit {Case 1: strdw = "points"; Break; case 2: strdw = "angle"; break; cas 3: strdw = "yuan"; break; case 4: strdw = "pick"; break; case 5: strdw = "佰"; break; case 6: strdw = ""; Break; cas 7: strdw = "万"; break; cas 8: strdw = "pick"; break; case 9: strdw = ""; break; casse 10: strdw = "仟"; BREAK Case 11: strdw = "100 million"; Break; Case 12: ST RDW = "Pick up"; Break; Case 13: strdw = ""; Break; Case 14: strdw = "仟"; break;} switch (strarr [intfen-1]) // Select Number {CASE "1": Strnum = ""; Break; Case "2": strnum = ""; Break; Case "3": strnum = "叁"; Break; Case "4": strnum = ""; Break; Case "5": Strnum = "Wu"; Break; Case "6": Strnum = "Lu"; Break; Case "7": strnum = "柒"; break; case "8": strnum = "捌"; Break; Case" 9 ": Strnum =" 玖 "; Break; Case" 0 ": strnum =" zero "; break;} // Handling special case strnow = strbig.split ("; // divided into zero Situation IF ((i == 1) && (strrr [INTFEN-1] == "0") strbig = "whole"; // angle is zero - ELSE IF ((i == 2) && STRARR [INTFEN-1] == "0") {// At the same time, when the zero is (strbig! = "whole" strbig = "zero" strbig;} // yuan is zero case ELSE IF (i == 3) && (strarr [intfEN-1] == "0") strbig = "yuan" strbig; // Pick up - 中 位 且 且 且 且 且 且 且 且 且 且Else IF ((i <7) && (i> 3) && (Strarr [INTFEN-1] == "0" && (Strnow [0]! = "Zero" && (strnow [0]! = "Yuan") strbig = "zero" strbig; // Pick up - 中 位 且 且 ELSE IF ((i <7) && ((i <7) && I> 3) && (strrr [intfEN-1] == "0" && (Strnow [0] == "zero") {} // Pick up - a middle one is zero and the previous one is Yuan and Cross ELSE IF ((i <7) && (i> 3) at zero (Strarr [INTFEN-1] == "0" && (Strnow [0] == "Yuan") {} // When you are zero, you must make up the mean word else if ((i == 7) && (Strarr [INTFEN-1] == "0") strbig = "10,000" strbig; // Pick up 10,000 Zero and the previous one (10,000 or more) is not zero ((i <11) && (i> 7) && (strrr [intfen-1] == "0" && (STRNOW [0 ]! = "Zero" && (Strnow [0]! = "10,000") strbig = "zero" strbig; // Pick up 10,000,000 in zero, the previous one (more than 10,000) is also zero His ELSE IF when the situation ((i <11) && (i> 7) & & (straarr [intfEN-1] == "0" && (Strnow [0] == "10,000) {} // Pick up 10,000 in one bit is zero and the previous one is 10,000 and zero Situations across else IF ((i <11) && (I> 7) && (Strarr [INTFEN-1] == "0" && (STRNOW [0] == "zero") {} // million For zero and there is a position and more than 100,000, it will make up ELSE IF in 10,000 ((i <11) && (I> & "! =" 0 "&& (Strnow [0] = = "Wan" && (Strnow [2] == "仟") strbig = strnum strdw "万 零" strbig.substring (1, strbig.Length); // handle 100 million else if (i == 11 ) {// billion bits are zero, when there is zero, go to zero IF ((strnow [INTFEN-1] == "0" && (strnow "==" 10,000 "&& (Strnow [2] == "") strbig = "100 million" "zero" strbig.substring (1, strbig.Length); // billion is zero and the full zero does not exist, remove the Else IF ((strnow [INTFEN-1] == "0" && (Strnow [0] == "Wan" && (Strnow [2]! = "仟") strbig = "hundred million" strbig.substring (1, strbig. LENGTH); // billion is not zero and the full zero existence, remove the qi else IF ((strNow [0] == "10,000" && (Strnow [2] == "仟") strbig = Strnum strDw "zero" strbig.substring (1, strbig.Length); // billion is not zero and unsained, remove the else Else IF ((strNow [0] == " "&& (STRNOW [2]! =" 仟 ") strbig = strnum strdw strbig.substring (1, strbig.Length); // Other normal conditions ElseSStrbig = Strnum strDw strbig;} // pick up billion - Yizhong one is zero and its previous one (i <15) && (i> 11) && (straarr [intfen-1] == "0" && (Strnow [0]! = "zero" && (STRNOW [0]! = "100 million") strbig = "zero" S TRBIG; // Pick up ELSE IF when a one is zero, and the former one (hundred million) is also zero ((i <15) & & (i> 11) && (straarr [intfEN-1] == "0" && (Strnow [0] == "100 million") {} // pick up 100 million yuan in a zero and the previous one Else IF ((i <15) && (I> 11) && (Strarr [INTFEN-1] == "0" & quot; 0 "& STRRNOW [0] ==" zero " {} // billion is zero and does not exist in 10 million and more than 10 billion times to remove the zero ELSE IF written for the last time ((i <15) && (I> 11) && (strarr [intfen-1]! = "0" && (Strnow [0] == "zero" && (Strnow [1] == "Billion" && (Strnow [3]! = "仟") strbig = strnum strdw strbig.substring (1, strbig .length); // billion is zero and there is 10 million and more than 10 billion times, in 100 million yuan to make up ELSE IF ((i <15) && (i> 11) && (strarr [intfen-1] ! = "0" && (STRNOW [0] == "zero" && (Strnow [1] == "100 million" && (Strnow [3] == "仟") strbig = strnum strdw "hundreds of zero" strbig . Substring (2, strbig.length); elseStrbig = Strnum strdw strbig; strfen = strfen.substring (0, intfEN-1); intfen = strfen.Length; strarr = strfen.split (";} return } catch (err) {return "; // Returns the original value} if it fails}} I hope that this method is helpful to everyone. I think of this, I think of it later, supplement. Eclipse Reply to: 2002-10-07 23: 27: 2311: Deleting all directories under the folder: / * * Delete all files under a directory * / public static void deLallFile (String Path) {file file = new file PATH); if (! file.exists ()) return; if (! file.Indirectory ()) return; string [] templist = file.list (); file temp = null; for (int i = 0; i < Templist.Length; i ) {if (path.endswith (file.separator)) Temp = new file (Path Templist [i]); else temp = new file (path file.separator templist [i]); if (Temp.isfile ()) Temp.delete (); if (Temp.Indirectory ()) deLallFile (Path Templist ");}} 12: String conversion to time and time subtraction: 1 SimpleDateFormat Formatter = New SimpleDateFormat ("YYYY.MM.DD"; // 假 定 200 2002.07.04 is illegal. String str = "2002.07.04"; paraSeposition POS = new paraSeposition (0); DATE DT = formatter.parse (STR, POS); if (dt! = Null) {// is a legal date} else {// illegal date } 2 Two dates are subtracted to import java.util. *; Import java.text. *; Class a {public static void main (string [] args) {string S1 = "2003/08/15 17:15:30" String S2 = "2002/09/14 14:18:37"; try {simpledateformat formatter = new SimpleDateFormat ("YYYY / MM / DD HH: MM: SS"; Parseposition Pos = New PaSeposition (0); Parseposition Pos1 = New parasePosition (0); DATE DT1 = formatter.parse (S1, POS); DATE DT2 = formatter.Parse (S2, POS1); System.out.Println ("DT1 =" DT1); System.out.Println "DT2 =" DT2); long l = dt1.getime () - dt2.gettime (); system.out.println ("Hello World! =" L);} catch (exception e) {system.out. Println ("Exception" E.TOString ());}}} 3 Get 2 months later: Import java.util. *; import java.text.dateFormat; public class test2 {public static void main (String Args []) Throws Exception {string Date = "2001/11/30"; DATEFORMAT DATEFORMAT = DateFormat.GetdateInstance (DateFormat.medium); Gregori Ancalendar GRC = New Gregoriancalendar (); Grc.Settime (New Date (Date)); Grc.Add (Gregoriancalendar.Month, 2); System.out.Println ("GRC =" DateFormat.Format (grc.getime () ));}} 13: jsp / servet redirects: do not change the url: 1:) servlet: public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {getServletContext () getRequestDispatcher (test2URL) .forward (. Request, response); 2JSP /Web/mail/pop3.jsp".eclipse Reply to: 2002-10-07 23: 27: 5414: JB7 WebLogic6.x configuration method is as follows: Win 2000 Temp, TMP configuration Because we generated EJB related code to do A series of compiled, then the generated temporary file must be placed, but the TEMP in Win2000, the TMP directory is equipped with spaces such as% UserProfile% / local settings / temp, let's configure: 1) Right-click "My Computer" selection attribute, select "Advanced", select "Environment Variable" button, 2) to modify the TEMP, TEMP, TMPDIR option in "ADMINISTRATOR's Variable" and "System Variable" in the pop-up dialog Click Each option, then "Edit" (right), change each variable called Temp, Temp, TMPDIR's value is changed to C: / Winnt / Temp, of course, this is not necessary, just I suggest you Don't be difficult to do. If it is finished, if it is finished, the win2000 environment should have no problem. WebLogic 6.x part, the JDBC Connection Pool configuration is in the MYSQL small database as an example before performing this configuration, first want The database JDBC driver JAR file is placed in the D: /bea/wlserver6.1/lib/jdbc directory (suggest this, there is no JDBC directory to build a), then edit d: /bea/wlserver6.1/config/ STARTWEBLOGIC.CMD file under Mydomain, JDBC driver files in the database, such as red word :: runweblogicecho onset path =. / bin; ./ bin / OCI817_8; D: / Oracle / ORA81 / BIN;% PATH% SET ClassPath =. / Lib / cr_wls60f.jar; ./ lib / weblogic_sp.jar; ./ lib / weblogic.jar; ./ lib / jdbc / mysql.jar This WebLogic startup will only be loaded with the database JDBC driver, configuration It will also be normal, otherwise it will be reported. 1) Expand Services / JDBC / Connection Pools2 in the WebLogic console) Click Configure a New JDBC Connection Pool.. .3) Fill in each parameter, the results are as follows: URL: JDBC: mysql: //127.0.0.1: 3306 / TestDriver classnamerg.gjt.mm.mysql.driverproperties (key = value): user = root4) Don't forget Click Apply to apply:) 5) The initial capacity, maximum capacity, capacity growth, etc. signed, and the above configuration work is not true, and the above configuration work has not been true. Go to WebLogic, so take a step, choose the Targets check, select the Servers check, select MyServer in Available, then click "->", then click Apply Apply. This way that we do will really be actually effective. WebLogic will only know the JDBC Connection Pool II. Configuring Data Source 1) In the WebLogic Console, use the Services / JDBC / TX Data Sources2 in turn.) Click Configure A New JDBC TX. Data Source ... 3) Fill in each parameter, as follows: JNDI Name: MySQLDataSorucePoolName: MySQLPoolrow Prefetch Size: 48Stream Chunk Size: 2564) Don't forget to apply :) 5) Similarly, choose Targets , Select the Servers check, select MyServer in Available, then click "->", then click Apply. This way that we do will really be actually effective, and WebLogic will only know the DataSource we have configured. JBUILDER 7 related configuration 1. Lame as WebLogic, before performing this configuration, put the database JDBC driver JAR file in the D: / jbuilder7 / lib / jar file (suggesting this, no JDBC directory to build a) 1) Open JBuilder 7, click Tools / Enterprise Setup ....... 2) Select the Database Drivers Sign 3 in the pop-up window) Point Add button, pop up a new window (maybe you Slightly different from the graph) 4) Click the New ... button, pop up a new window, and change the Name: The default value is mysql (as long as it makes sense, what is all the names) 5) Click Add. .. button to find and add a database of JDBC driver, of course, we go to D: / jBuilder7 / lib / jdbc, choose mysql.jar, pay attention, don't expand mysql.jar, select the picture, then press OK. . Tip: You can match the SHIFT and CTRL keys to select multiple .jar files. 6) The result is as follows, if there is a plurality of .jar files that need to be added, you can also click the Add ... button to continue adding. 7) OK exit. OK, then MySQL JDBC driver has been added. 9) OK again, JBuilder prompts to restart, the above configuration will take effect, determine and restart JBUILDER. Second, the configuration of EJB 2.0 and application servers, with WebLogic 6.x as an example to install Borland Enterprise Servler 5.02 before doing this configuration, IAS 4.5 is also a matter, both of them, of course, I am new. Old, installation procedure, because it is very easy! Basically, I will install my installation in D: / BorlandEnterpriseserver. 1) Open JBuilder 7, click Tools / Enterprise Setup ....... 2) Select the CORBA sign, drop-down list box under Configuration, select Visibroker 3) Select Edit ..., pop-up Edit Confiuration window Click Path for ORB Tools 4) Click Path for ORB Tools: Browse the ... Browse button, pop up the Select Directory window, select D: / BorlandEnterpriseServer5 / bin and OK. 5) Two times, OK, JBuilder asked you to restart, no way, do it, restart JBuilder. 6) After restart, go to Tools / Enterprise Setup ......., choose CORBA item, select Edit, select Library for Projects next to the pop-up window ... button 7) User in the new window in the pop-up You will find more options Borland Enterprise Server 5.0.2 Client, which is displayed in the picture, and then exits three times ok. Select Project / Default Project Properties item 9) Select a Server sign in the dialog box, click ... Buttons, 10) In the new dialog box that pops up, select WebLogic Application Server 6.x , then check Enable Server, see the red box in the figure. 11) After checking Enable Server, other optional or detailed, click ... buttons, select Home Directory; select Working Directory; for your machine's WebLogic location. 12) Click on the Add button in the Class sign, add it to the D: /Bea/wlserver6.1/lib/cr_wls60f.jar file. As shown in the red line above. Use the MOVE UP button to move the D: /bea/wlserver6.1/lib/cr_wls60f.jar file, because generally added .jar files at the bottom side. This step is also more important, because WebLogic can be launched directly in the JBuilder environment, then it is necessary to test whether License is legal, that is, the cr_wls60f.jar file exists. 13) Select the Custom check, configure it as shown in the following red line, may have a different WebLogic directory location to have me, but it is the same. After configuring, click the OK button to exit Domain Name: MyDomain Server Name: MyServer Version: 6.1 Service Pack1 (D: /Bea/WLSer6.1) 14) Single Server for All Services in Project drop-down list box in the picture window Select WebLogic Application Server 6.x as shown, then OK exits. 15) When this JBuiler 7 is completed with WebLogic 6.x, then let's start! This configuration has 9CBS-WJMML (smile and sad). I spent a long time. If you reprint, please don't delete the Bank. Eclipse replied: 2002-10-07 23:28:45 俺 俺,,,, 15 15 15 隔 隔 隔 隔 隔 隔 隔 隔 隔 隔 隔 隔 () / (3600 * 24 * 1000)} 16. Date Add or decrease SimpleDateFormat SDF = New SimpleDateFormat ("YYYYMMDD"; String Str = "20011230"; DATE DT = SDF.PARSE (Str, New PaSeposition (0)); Calendar RightNow = Calendar.getInstance (); RightNow.SetTime (DT); RightNow.Add (Calendar.date, 2); // You have to decrease date DATE DT1 = RightNow.getTime (); string restr = sdf.format (DT1, "", new fieldPosition (0); system.out.println (restr); 17. Time display control first way:
18. Encryption & Decryption When the string STR is encrypted before inserting the database: java.net.urlencoder.Encode (String Str); decoding again when removed from the database: (You can do not encrypt, only decode, try it; No re-encryption) Java.net.urdecoder.Decode (String Str); 19. Page refresh: There are three ways: 1, add: