`
iloveoracle
  • 浏览: 118825 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

java.io.*

    博客分类:
  • java
阅读更多
   
package util;import java.io.*;import java.text.simpledateformat;import java.util.date;public class basetest {	/**	 * @param args	 * @throws exception	 */	public static void main(string[] args) throws exception {		// todo auto-generated method stub		// system.out.println(hibernatesessionfactory.getsession().tostring());		char ch[] = new char[26];		string arr[] = new string[25];		int j = 0;		for (int i = 97; i < 98 + 25; i++) {			ch[j] = (char) i;			j++;		}		for (int i = 1; i <= 2; i++) {			file f = new file("d:/群发用户/邮件群发用户--"					+ new simpledateformat("yyyy-mm-dd").format(new date())					+ "--" + i + ".txt");			f.createnewfile();			fileoutputstream out = new fileoutputstream(f);			outputstreamwriter w = new outputstreamwriter(out);			if (i == 1) {				w.write("domain:aiwow.cc" + "\r\n");				for (int k = 1; k <= 25; k++) {					string str = "";					for (int r = 1; r <= 5; r++) {						int index = (int) (math.random() * 25);						str += ch[index];					}					arr[k - 1] = str;					w.write(str + ",123456,爱我网" + "\r\n");				}			} else {				for (int k = 1; k <= 25; k++) {					string temp = arr[k - 1];					w.write("y," + temp + "@aiwow.cc," + temp							+ "@aiwow.cc,123456,127.0.0.1,25,n" + "\r\n");				}			}			w.close();			out.close();		}		system.out.println("文件生成成功.....");	}}

	<!--  -->		<div id="go_active" style="width:100%;height:60px;position:absolute;display:none;">			<div style="margin:0px auto; width:968px;">				<iframe frameborder="0" 					style="position:absolute;top:1px;z-index:0; solid #000; height: 60px;width:968px;; _height: 60px; _width: 968px;background-color: #fff;"></iframe>				<div style="position:absolute;">					<a href="http://www.aiwow.cc/activity/huodong.html" target="_blank">					<img src="/images/go_active.jpg" /></a>				</div>					<div  style="top:1px;width:968px;text-align:right;position:absolute;">							<a href="javascript:void(0);" onclick="nodis('go_active');"><img src="/user/images/lwx-gb.jpg" width="59" height="23" /></a>			 	</div>			</div>			</div>		<!-- 束-->




var tr;tr = table.insertrow(0);tr.height=25;tr.onclick=function(){ alert("tr created!")}var cellfuncs = [     function(data) {      return data.replydate;     } ];   dwrutil.addrows(       'lines',       templist,       cellfuncs,       {        rowcreator : function(options) {         var row = document.createelement("tr");//鼠标移动到行上面,背景色和行高改变row.onmouseover = function(){this.style.backgroundcolor='#dedfde';this.style.height='26';}row.onmouseout = function(){this.style.backgroundcolor='#ffffff';this.style.height='25';}//设定行的其他样式row.setattribute("height","25" );row.setattribute("bgcolor","#ffffff" );row.setattribute("align","center" );row.setattribute("style","" );row.style.backgroundcolor = "#ffffff";         return row;        },        cellcreator : function(options) {         var td = document.createelement("td");         var index = options.cellnum;         if (index == 0) {          td.height = "25";         }         return td;        },        escapehtml :false       });cell1.attachevent("onmouseover",onover); //单元格插入onmouseover事件   



自己对sql的理解。用一句俗话说:人有七窍,已经通了六窍,有没有童鞋指点一下问:关系模式:user(userid, username), article(articleid, userid, title,   content),vote(articleid, score),user为用户关系,article为用户发表的文章关系,vote为文章得票关系,title为文章标题、score为得票数。(1)用sql语言查询所有没发表过文章的用户名;(2)用sql语言查询得票数大于100的所有文章标题,按得票数倒序排列;(3)用sql语言查询出发表文章数大于5,文章平均得票数大于100的用户名,按平均得票数倒序排列;(4)设计这些表的主键、外键和索引,并指出上面三个查询所使用的索引。(5)当用户数超过1000万,文章数超过1亿时,如何考虑存储及性能的改进和优化?  答:  1 select * from user where useid  not in(select userid from article);2 select title from article   inner  join vote  on article.articleid=vote.aritcleid and  vote.score>100 order by vote.score asc; 3有点不太会,下面胡乱乱写了一通3 select * from user where userid in(select userid from article inner join vote on article.articleid = vote.articleid group by userid  having avg(score)>100) group by userid having count(*) >5;4主键外键应该很简单,索引第一个应该是userid,第二个是articleid 和score,第三个应该是articleid和 userid5用户数按照id分割分布式存储,文章类似,还可以用读写分离等策略水平扩展数据库.
 
0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics