<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    置頂隨筆

    很奇怪,自從我上次拆了一下內存條 后,有時我打開IE時會彈出一個錯誤對話框,發出一下提示:
    1:
    出現了運行時間錯誤。是否要進行調試?
     行:1616
    錯誤:未結束的字符串常量

    2:出現了運行時間錯誤。
    是否要調試?
    行:1443
    錯誤:缺少對象

    這是什么原因導致IE發出這樣的錯誤警告呢?剛開始我還以為是我的內存條壞了,一位是我內存條上的存儲顆粒被我搞掉了一些,因為上次我看到內存上有許多灰塵,就用布去抹灰塵的。
    其實是我把的IE中“Internet選項”中的“高級”下的 “禁止腳本調試Internet Explorer” 這一欄的勾去掉了,那就代表我允許調試IE了,所以腳本在調試IE時就報錯了。
    為了避免這種情況,應該將一項勾上

    posted @ 2008-12-08 22:42 Running 閱讀(265) | 評論 (0)編輯 收藏

    2008年12月17日

     

     

    錯誤代號       十六進制      錯誤類型

    1001           0x800A03E9   內存不足

    1002           0x800A03EA   語法錯誤

    1003           0x800A03EB   需要“ : ”

    1004           0x800A03EC   需要“ ; ”

    1005           0x800A03ED   需要“ ( ”

    1006           0x800A03EE   需要“ ) ”

    1007           0x800A03EF   需要“ [ ”

    1008           0x800A03F0   需要“ ] ”

    1009           0x800A03F1   需要“{ ”

    1010           0x800A03F2   需要“ } ”

    1011           0x800A03F3   需要標志符

    1012           0x800A03F4   需要“ / ”

    1013           0x800A03F5   無效數

    1014           0x800A03F6   非法字符

    1015           0x800A03F7   字符串常量未結束

    1016           0x800A03F8   注視未結束

    1018           0x800A03FA   函數外有"return"語句

    1019           0x800A04FB   在循環外 不能有“break“

    1020           0x800A05FC   在循環外 不能有“continue“

    1023           0x800A03FF   需要十六制數

    1024           0x800A0400   需要"while"

    1025           0x800A0401   標簽定義重復

    1026           0x800A0402   未找到標簽

    1027           0x800A0403   一條"switch"語句中只能有一個"default"

    1028           0x800A0404   需要標識符,字符串或者數字

    1029           0x800A0405   需要"@end"

    1030           0x800A0406   條件編譯已關閉

    1031           0x800A0407   需要常數

    1032           0x800A0408   需要"@"

    1033           0x800A0409   需要 "catch"

    1034           0x800A040A   需要"var"

    1035          0x800A041B   "Throw" 的后面必須跟一個表達式,且在同一

                                       源代碼行上

    posted @ 2008-12-17 22:37 Running 閱讀(260) | 評論 (0)編輯 收藏

    2008年12月11日

    /**
     *
     */
    package test;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    /**
     * @author huangqin
     *
     */
    public class QuestString {

     private int curPage;//當前頁數
     private int maxPage;//最大頁數
     private int maxRowCount;//總記錄數
     private int pageSize=2;//每頁顯示的記錄數
     private DBResult db;//記錄集對象
     private String httpfile;//當前地址欄的文件,即具體的jsp文件
     private String cif;//選擇的查詢字段
     private String ccif;//選擇的查詢運算符
     private String qvalue;//查詢關鍵字
     private String countSql=null;//用來存儲select count(*)。。。。語句
     private String topSql=null;//用來存儲select top2.。。。語句
     private String nowPage=null;//初始化當前頁curPage變量,即獲得當前頁的具體頁號
     private String str_parameter;//在做翻頁時,傳遞除pages外的其他參數
     private String andor;//查詢的與/或條件
     private String sdate;//查詢其實時間
     private String edate;//查詢結束時間
     private String paixu;//排序方法
     private String orderby;//排序條件
     public QuestString() throws Exception{
      db=new DBResult();
     }
     public void setCurPage(int curPage){
      this.curPage=curPage;
     }
     public void setQuerySql(String httpfile,String pages,String strCount){
      this.httpfile=httpfile;
      this.nowPage=pages;
      this.countSql=strCount;
      try{
       querySql(countSql);
      }catch(Exception e){
       e.printStackTrace();
      }
     }
     public  void querySql(String countSql)throws SQLException {
      // TODO Auto-generated method stub

      if(this.nowPage==null){
       this.curPage=1;
      }else{
       this.curPage=Integer.parseInt(this.nowPage);
       if(this.curPage<1){
        this.curPage=1;
       }
      }
      ResultSet rsCount=db.getResult(countSql);
      if(rsCount.next()){
       this.maxRowCount=rsCount.getInt(1);//獲取記錄總數,即所要查詢記錄的總行
      }
      //余數為0則總頁數=兩數整除的結果,若不為0則總頁數=兩數整除結果+1
      this.maxPage=(this.maxRowCount%this.pageSize==0)?(this.maxRowCount/this.pageSize):
       (this.maxRowCount/this.pageSize+1);
      if(this.curPage>this.maxPage){
       this.curPage=this.maxPage;
      }
      rsCount.close();
     }
     public String pageFooter()
     {
      String str="<form action="+this.httpfile+"name=formBean method=post>";
      int prev=this.curPage-1;//前一頁
      int next=this.curPage+1;//后一頁
      
      str=str+"<font style='font-size:10pt'>總計<font color='red'>"+this.getMaxRowCount()+
      "</font>條記錄,"+"“共<font color='red'>"+this.getMaxPage()+"</font>頁”";
      str=str+" ”<font color='red'>"+this.pageSize+"</font>條/頁”當前頁<font color='red'>"+
      this.getMaxPage()+"</font>頁&nbsp;";
      if(this.curPage>1)
       str=str+"<A href="+this.httpfile+"?pages=1"+str_parameter+">首頁</A>";
      else
       str=str+"首頁";
      if(this.curPage>1)
       str=str+"<A href="+this.httpfile+"?pages="+prev+str_parameter+">上一頁</A>";
      else
       str=str+"上一頁";
      if(this.curPage<this.maxPage)
       str=str+"<A href="+this.httpfile+"?pages="+next+str_parameter+">下一頁</A>";
      else
       str=str+"下一頁";
      if(this.maxPage>1&&this.curPage!=this.maxPage)
       str=str+"<A href="+this.httpfile+"?pages="+this.maxPage+str_parameter+">尾頁</A>";
      else
       str=str+"尾頁</font>";
      //在頁面跳轉間設置隱藏表單,來保存不同的請求
      str=str+"轉到<input type='text' name='pages' size=2>頁"+
      "<input type='hidden' name='ccif' value='"+this.ccif+"'>" +
        "input type='hidden' name='cif' value='"+this.cif+
        "'><input type='hidden' name='qvalue' value='"+this.qvalue+
        "'><input type='hidden' name=andor' value='"+this.andor+
        "'><input type='hidden name='sdate' value='"+this.sdate+
        "'><input type='hidden name='edate' value='"+this.edate+
        "'><input type='hidden' name='orderby' value='"+this.orderby+
        "'><input type='hidden' name='paixu' value='"+this.paixu+
        "'><input type='submit' name='submit' value='go'></form>";
      return str;
     }
     private int getMaxPage() {
      // TODO Auto-generated method stub  
      return maxPage;
     }
     private int getMaxRowCount() {
      // TODO Auto-generated method stub
      return maxRowCount;
     }
     //根據不同條件獲取不同查詢前N條的SQL語句
     public String getString(String table){
      
      if(ccif.equals("="))
      {
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table+"where"+
       ""+cif+"="+"'"+qvalue+"'";
       return strSql;
      }
      else if(ccif.equals("LIKE"))
      {
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table+
       "where"+""+cif+""+"like"+""+"'%"+qvalue+"%'";
       return strSql;
      }
      else if(ccif.equals("ALL")){
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table;
       return strSql;
      }
      else if(ccif.equals("<"))
      {
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table+
       "where"+cif+"<'"+qvalue+"'";
       return strSql;
      }
     return null;
     
     }
     //根據不同條件獲取不同的計算記錄總數的SQL語句
     public String getCount(String table){
      
      if(ccif.equals("=")){
       String strSql="select count(*) from"+table+"where"+""+cif+"="+"'"+qvalue+"'";
       return strSql;
      }
      else if(ccif.equals("LIKE")){
       String strSql="select count(*) from"+table+"where"+""+cif+""+"like"+""+"'%"+qvalue+"%'";
       return strSql;
      }
      else if(ccif.equals("ALL")){
       String strSql="select count(*) from"+table;
       return strSql;
      }
      else if(ccif.equals("<")){
       String strSql="select count(*) from "+table+"where"+cif+"<'"+qvalue+"'";
       return strSql;
      }
      return null;
      
     }
     //根據不同條件和不同的起始日期和結束日期獲得不同的計算記錄總數的SQL語句
     public String getDateCount(String table){
      if(ccif.equals("=")){
       String strSql="select count(*) from"+table+"where"+""+cif+"="+"'"+qvalue+"'"+
       andor+"xsdate between'"+sdate+"'and'"+edate+"'";
       return strSql;
      }
      else if(ccif.equals("LIKE")){
       String strSql="select count(*) from"+table+"where"+""+cif+""+"like"+""+"'%"+qvalue+"%'"+
       andor+"xsdate between'"+sdate+"'and'"+edate+"'";
       return strSql;
      }
      else if(ccif.equals("ALL")){
       String strSql="select count(*) from"+table;
       return strSql;
      }
      
      return null;
     }
     //根據不同條件和不同的起始日期和結束日期獲得不同的查詢,前N條的SQL語句
     public String getDateString(String table){
      if(ccif.equals("="))
      {
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table+"where"+
       ""+cif+"="+"'"+qvalue+"'"+andor+"xsdate between'"+sdate+"'and'"+edate+"'";
       return strSql;
      }
      else if(ccif.equals("LIKE"))
      {
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table+
       "where"+""+cif+""+"like"+""+"'%"+qvalue+"%'"+andor+"xsdate between'"+sdate+
       "'and'"+edate+"'";
       return strSql;
      }
      else if(ccif.equals("ALL")){
       String strSql="select top"+this.pageSize*this.curPage+"*from"+table;
       return strSql;
      }
      
      return null;
     }
     //子查詢中得到從起始日期到結束日期這段時間所有不重復的spid(商品id),并返回不重復的spid的總數
     //其中spid是一個數據庫中一張表中的一個屬性(一列),元組(一行)
     public String getOrderCount(String table){
      String strSql="select count(*) from (select spid from"+table+"where xsdate between'"+
      sdate+"'and'"+edate+"'group by spid) as aa";
      return strSql;
      
      
     }
     public String getOrderString(String table){
      String strSql="select top"+this.pageSize*this.curPage+"* from tb_brand a inner join" +
        "(select spid,sum(sl)as sl,sum(je)as je"+
        "from "+table+"where xsdate between'"+sdate+"'and'"+edate+"'group by spid)"+
        "as b"+"on a.id=b.spid order by"+orderby+""+paixu;
        return strSql;
      

     }
    }

    posted @ 2008-12-11 20:54 Running 閱讀(478) | 評論 (1)編輯 收藏
     

    package test;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.DataSource;

    /**
     * @author huangqin
     *
     */
    public class DBConn {
     public static synchronized Connection getConnection() throws Exception{
      try{
       Context initCtx=new javax.naming.InitialContext();//獲取JNDI初始上下文對象
       //在JNDI命名空間java:comp/env段里獲得上下文對象
       Context envCtx=(Context)initCtx.lookup("java:comp/env");
       DataSource ds=(DataSource)envCtx.lookup("jdbc/xscj");
       return ds.getConnection();
      }catch(SQLException e){
       throw e;
      }catch(NamingException ex){
       throw ex;
      }
     }

    }

    package test;
    import java.sql.*;
    import test.DBConn;
    /**
     * @author huangqin
     *
     */
    public class DBResult {

     private Connection con;
     public DBResult() throws Exception{//一定要拋出異常,否則報錯
      this.con=DBConn.getConnection();
     }
     public ResultSet getResult(String sql){
      try{
       Statement stmt=con.createStatement();
       ResultSet rs=stmt.executeQuery(sql);
       return rs;
      }catch(Exception e){
       return null;
      }
     }
     public void doExecute(String sql){
      try{
       Statement stmt=con.createStatement();
       stmt.executeQuery(sql);
      }catch(Exception e){}
     }
     public PreparedStatement getPreparedStatement(String sql){
      try{
       PreparedStatement pstmt=con.prepareStatement(sql);
       return pstmt;
      }catch(Exception e){
       return null;
      }
     }
     public void closeConn(){
      try{
       this.con.close();
      }catch(Exception e){
       e.printStackTrace();
      }
     }
    }

    posted @ 2008-12-11 20:53 Running 閱讀(172) | 評論 (0)編輯 收藏
     

    import java.util.*;
    /**
     * @author huangqin
     *
     */
    public class ShowTime {
    private Date date=null;
    private int yy;
    private int mm;
    private int dd;
    private String sy;
    private String sd;
    private String sm;
    public ShowTime(){
     date=new Date();
     yy=date.getYear()+1900;
     mm=date.getMonth()+1;
     dd=date.getDate();
     sy=String.valueOf(yy);
     sm=String.valueOf(mm);
     sd=String.valueOf(dd);
     if(sm.length()==1){
      sm="0"+sm;}
     if(sd.length()==1){
      sd="0"+sd;
     }
    }
     public String getDateString(){
      return sy+sm+sd;
     }
     public String getDate(){
      return sy+"-"+sm+"-"+sd;
     }
    }

     

    posted @ 2008-12-11 20:51 Running 閱讀(317) | 評論 (0)編輯 收藏

    2008年12月10日

    數據庫連接池的解決方案:再應用程序啟動時建立足夠的數據庫連接,并將這些連接組成一個
    連接池,使應用程序動態的對池中的連接進行申請、使用和釋放。對于多余連接池中連接數的并發請求,需要再請求隊列中排隊等待,并且應用程序可以根據池中連接的使用率,動態增加或減少池中的連接數。

    數據源接口java.sql.DataSource的一些方法如下:

    getConnection():獲得一個Connection對象。
    getConnection(String username,String password);獲得一個帶有用戶名和密碼的Connction對象。
    getLongWriter();從DataSource中獲得LongWriter對象,它是PrinterWriter的實例
    setLongWriter(PrintWriter out):設置Datasource的LongWriter
    getLOginTimeout():獲得DataSource嘗試連接數據庫的最大時間
    SetLoginTimeout(int seconds):設置DataSource嘗試連接數據庫的最大時間

    posted @ 2008-12-10 22:05 Running 閱讀(115) | 評論 (0)編輯 收藏
     

    //其中default.htm默認已經存在
    <script language="javascript" >
    function intro(){
    if((navigator.appVersion.indexOf("Mac")!=-1)&&
    (navigator.userAgent.indexOf("MSIE")!=-1)&&
    (parseInt(navigator.appVersion)=4)){
    skip()
    }else{
    popup()
    }
    }
    function skip(){
    location.href="default.htm";
    }
    function popup(){
    version=parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,
    navigator.appVersion.length));
    if(version>=4)
    version=parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,
    navigator.appVersion.length));
    if(version>=4){
    if(navigator.appName=="Netscape"){
    Hello=window.open("default.htm","Hello","scrollbars");
    Hello.focus();
    }
    if(navigator.appName=="Microsoft Internet Explorer"){
     window.open("default.htm","screen","fullscreen==yes");
     }
     else{
     location.href="default.htm";
     }
     }
     </script>

     

    posted @ 2008-12-10 21:48 Running 閱讀(466) | 評論 (0)編輯 收藏

    2008年12月9日

    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.ParseException;

    public class MyString
    {
    //對字符串進行GBK編碼
    public static String toChinese(String strvalue){
    try{
    if(strvalue=null){
    return ;;;
    }
    else{
    strvalue=new String(strvalue。getBytes("ISO8859_1"),"GBK");
    return strvalue;
    }
    }catch(Exception e){
    return "";
    }
    }
    }
    //對輸入的字符串過濾sql注入
    public static String StringtoSql(String str){
    str=nullToString(str,"");
    try{
    str=str.trim().replace("\",(char)1);
    }catch(Exception e){
    return "";
    }
    return str;
    }
    //讀取數據庫中數據時,過濾sql注入
    public static  String SqltoString(String str){
    str=nullToString(str,"");
    try{
    str=str.replace((char)1,"\").trim();
    }catch(Exception e){
    return "";
    }
    return str;
    }
    //對字符串進行Unicode編碼
    public static String toUnicode(String strvalue){
    try{
    if(strvalue==null){
    return null;
    }else{
    strvalue=new String(strvalue.getBytes("GBK"),"ISO8895_1");
    return strvalue;
    }
    }catch(Exception e){
    return "";
    }
    }
    //判斷當前時間
    public static boolean compareNowTime(String date){
    SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
    Date d=null;
    try{
    d=format.parse(date);
    }catch(ParseException ex){
    }
    if(System.currentTimeMillis()-259200000<d.getTime()){
    return true;
    }
    return false;
    }
    //判斷用戶輸入的字符是數字還是字母
    public static boolean isID(String str){
    if(str!=null&&str.length()>0){
    if(str.charAt(0)<57&&str.charAt(0)>48)  return false;
    for(int i=0;i<str.length();i++){
    if(str.charAt(i)<65&&str.charAt(i)>57||str.charAt(i)>90&&str.charAt(i)<97&&
    str.charAt(i)!=95||str.charAt(i)>122||str.charAt(i)<48){
    return false;
    }
    }
    return true;
    }
    return false;
    }
    //對輸入數據中的HTML字符進行轉換
    public static final String escapeHTML Tags(String input){
    if(input==null||input.length()==0){
    return input;}
    StringBuffer buf=new StringBuffer(input.length());
    char ch='';
    for(int i=0;i<input.length();i++){
    ch=input.charAt(i);
    if(ch=='<'){
    buf.append("&lt;");
    }else if(ch=='>'){
    buf.append("&gt;");
    }else{
    buf.append(ch);  }
      }
    return buf.toString();
    }
    //對SQL語句中輸入的空值進行處理
    public static final String SqlToLink(String str){
    str=StringUtils.nullToString(str,"");
    if("".equals(str)){
    str="LIKE '%'";
    }else{
    str=("LIKE '%"+str+"%'");}
    return str;
    }
    }

    posted @ 2008-12-09 22:02 Running 閱讀(352) | 評論 (0)編輯 收藏

    2008年12月8日

    假定我要處理的form中的內容如下(在此我簡化了一下):
    <form name="myform">
    <input type="text" name="goodsName" size="8"><br>
    <input type="file" name="picture" ><br>
    <input type="text" name="price" size="5"><br>
    <input type="submit" name="submit" value="submit">&nbsp;&nbsp;
    <input type="reset" name="reset" value="reset">
    </form>

    下面是用JS來驗證輸入數據的合法性:

    <script language="javascript">
    function mycheck(){
    if(myform.goodsName.value==""){
    alert("請輸入商品姓名");
    myform.goodsName.focus();
    return;
    }
    if(myform.picture.value==""){
    alert("請輸入圖片文件的路徑");
    myform.picture.focus();
    return;
    }
    if(myform.price.value==""){
    alert("請輸入價格");
    myform.price.focus();
    return;
    }
    myform.submit();
    }
    </script>

    posted @ 2008-12-08 23:09 Running 閱讀(815) | 評論 (1)編輯 收藏

    2008年12月7日

    public static Connection getConnection(){

    Connection conn=null;
    private  static    String dbUrl="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_shop”;
    private static   String dbUser="sa";
    private static String dbPwd="";
    private static String dbClassName=“com.microsoft.jdbc.sqlserver.SQLServerDriver";
        //   loadProperty();//通過loadProperty方法讀取properties文件中的數據庫連接所需信息
                try{
                            Class.forName(dbClassName).newInstance();
                            conn=DriverManager.getConnection(dbUrl,dbUser,dbPwd);
    }catch(Exception ee){
               ee.printStackTrace();
    }
    if(conn=null){
    System.err.println("警告:DbConnectionManager.getConnection() 獲得數據庫連接失敗。\r\n\r\n連接;類型:"+dbClassName+"\r\n連接位置:"+dbUrl+"\r\n用戶/密碼"+dbUser+"/"+dbPwd);
    }
    return conn;
    }


    public ResultSet  executeQuery(String sql){
    try{
    conn=getConnection();
    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    rs=stmt.executeQuery(sql);
    }catch(SQLException ex){
    System.out.println(ex.getMessage());
    }
    return rs;
    }



    public int executeUpdate(String sql){
    int result=0;
    try{
    conn=getConnection();
    stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    result=stmt.executeUpdate(sql);
    }catch(SQLException ex){
    result =0;
    }try{
    stmt.close();
    }catch(SQLException ex1){
    return result;
    }

    public void close(){
    try{
    if(rs!=null){
    rs.close();
    }
    }catch(Exception e){
    e.printStackTrace(System.err);}
    try{
    if(stmt!=null){
    stmt.close();
    }
    }catch(Exception e){
    e.printStackTrace(System.err);
    }
    try{
    if(conn!=null){
    conn.close();
    }
    }catch(Exception e){
    e.printStackTrace(System.err);
    }
    }
    }
    posted @ 2008-12-07 23:31 Running 閱讀(155) | 評論 (0)編輯 收藏
     
    public String convertStr(String string){
    if(string==null){
               str1="";
    }else
                {
                           try{
                                             string=string.replaceAll("<","&It;");
                                              string=string.replaceAll(">",“&gt”);
                                               string=string.replaceAll("","&nbsp;");
                                              string=string.replaceAll("\r\n","<br>");
                                        }catch(Exception e){
                                    e.printStackTrace(System.err);
                             }
                      }
    return string;
    }
    posted @ 2008-12-07 22:48 Running 閱讀(3672) | 評論 (2)編輯 收藏
    僅列出標題  
     
    主站蜘蛛池模板: 亚洲婷婷综合色高清在线| 亚洲图片中文字幕| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 亚洲av成人片在线观看| 免费理论片51人人看电影| 亚洲精品中文字幕| 成人爱做日本视频免费| 亚洲AV第一成肉网| AV在线亚洲男人的天堂| 一级毛片大全免费播放下载| 亚洲国产精品成人久久蜜臀| 一区视频免费观看| 国产AV无码专区亚洲AV男同| 95老司机免费福利| 亚洲视频在线观看2018| 日本免费一本天堂在线| 国产成人亚洲综合a∨| 在线亚洲精品自拍| 91精品国产免费久久国语蜜臀| 亚洲国产综合自在线另类| 免费无码又爽又刺激高潮| 一级做a爰黑人又硬又粗免费看51社区国产精品视 | 无码人妻精品中文字幕免费东京热| 亚洲冬月枫中文字幕在线看| 成在人线AV无码免费| 日韩在线观看免费| 亚洲国产精品久久久久网站| 免费精品国产自产拍在线观看图片 | 免费一级毛片在播放视频| 国产精品免费一区二区三区| 久久久久久亚洲AV无码专区| 夜夜嘿视频免费看| 中文字幕免费在线观看动作大片| 337p欧洲亚洲大胆艺术| 国产免费小视频在线观看| 日韩电影免费在线观看| 亚洲日韩av无码中文| 亚洲处破女AV日韩精品| 午夜爱爱免费视频| 国产精品白浆在线观看免费| 亚洲大尺度无码无码专线一区|