Some of the problems encountered in the completion of the design, as well as some tips

Source: Internet
Author: User
Tags mysql export database

The first time to do a stand-alone JSP website, encountered many problems ... Weak and weak

1. MyEclipse js file can not be saved, prompt "iso-8859-1" coding error. Find "General"-"Content Types", the right has a tree-shaped text, expand to find "JSP", the bottom has a "default encoding", which is the default "Iso-8859-1", finally found, deleted " Iso-8859-1 "Fill in" "UTF-8", click "Update", OK. Save again, there's no mistake.

2.         SQL statement Debugging tips, SQL statements to print out in MySQL execution, can be executed is a program error. 3.         myeclipse Use tips:  "ctrl+m"    window maximization and restore, when the user operates in a window , always feel that the current window is small (especially when writing code), now good, try "ctrl+m" shortcut keys.        "ctrl+/"    quickly add comments to quickly annotate or uncomment the row or selected line of the cursor, and you may need to annotate something or uncomment it when you debug , now well, do not need to repeat each line of comments        "alt+/"    this shortcut for users to edit a good helper, can provide users with content assistance, Do not worry about the method and attribute name, when you remember the name of the class, method and attributes, more experience the "alt+/" shortcut key benefits.        "Ctrl+o"    shows an outline of the methods and properties in a class that can quickly locate the methods and properties of a class and is useful when looking for bugs         "alt+←", "alt+→"    back history and forward history are very useful for tracking code, and users may have looked up several related places, but may not be able to remember, You can locate a class, method, and property of the cursor position by locating the order        "F3" by both shortcuts.        "ctrl+shift+f"    format code,       "CTRL + Shift+o "Quickly generate import, when copying a program from the Internet, do not know how to import into the called class, try" ctrl+shift+o "shortcut keys, there will be surprises.

4. When building MySQL database, it is best to use UTF-8 encoding, java default is UTF-8, when querying the database in Chinese will not because of inconsistent coding and can not be implemented

5. Change Eclipse's Workspace:window > Preferences > Workbench > Startup and Shutdown have prompt for workspace on s Tartup

6.         in the process of using JSP, the most annoying problem is the Chinese garbled problem, the following is my software development encountered in garbled problems and solutions. 1, JSP page garbled This garbled reason is not in the page specified use of the character set code, solution: As long as the beginning of the page with the following code to specify the character set coding can, 2, the database garbled this garbled will make you insert the database into garbled Chinese, or read out the display is garbled, The workaround is as follows: Add the coded character set string url= to the database connection string Jdbc:mysql://localhost/digitgulf?user=root&password=root&useunicode  =true&characterencoding=gb2312 ";  and use the following code in the page: Response.setcontenttype ("text/html;charset=gb2312"); Request.setcharacterencoding ("gb2312"); We have no direction, we have only ideals (onlyideal)-the ideal achievement tomorrow.  If you can not insert data in Mysql-front, may be a software problem, you can restart Eclipse,mysql server 3, Chinese as a parameter to pass garbled when we pass a paragraph of Chinese characters as a parameter to another page, there will be garbled situation, the solution is as follows: The parameter is encoded when the parameter is passed, such as rearshres.jsp?keywords= "" (keywords) and then receives the Keywords=new String using the following statement on the Receive Parameters page ( Request.getparameter ("keywords"). GetBytes ("8859_1");  above for the current situation of the garbled problem, garbled core problem or character set coding problem, as long as mastered this, The general garbled problem can be solved

7. MyEclipse because the encoding problem can not save the file, Windowàgeneralàappearanceàcontenttype find the appropriate file type, and then at the bottom of the iso-8859-1 to UTF8 or other point update on the OK

8. When MySQL inserts query data, enclose the character type with a semicolon.

9. mysql Export database mysqldump–uroot–proot database name > "a.txt" mysql establish unique index: create unique index index_name on table_name (COL Umn_name);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.