MySql 插入数据 帮忙看一下方法有什么问题
Java code:
public static void insertSong(List<Tone32> toneList){
Test23 t = new Test23();
try{
conn=t.getConn();
for(Tone32 tone : toneList){
String sql = "insert into tone (toneType,song,artist,price) values(?,?,?,?)";
pstm = conn.prepareStatement(sql);
pstm.setString(1, tone.getToneType());
pstm.setString(2, tone.getSong());
pstm.setString(3, tone.getArtist());
pstm.setDouble(4, tone.getPrice());
pstm.executeUpdate();
}
t.Close();
System.out.println("入库结束");
}catch(Exception e){
e.printStackTrace();
}
}
向MYSQL 里插入数据 我的toneList里有28000左右的数据
但是插入 12000多条的时候 抛异常
Java code:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.PreparedStatement.<init>(PreparedStatement.java:437)
at com.mysql.jdbc.Connection.clientPrepareStatement(Connection.java:2185)
at com.mysql.jdbc.Connection.prepareStateme
相关问答:
如题,这三个在win7下使用会有什么兼容性问题吗?
由于我最近在使用win7,就懒得进xp了!
自己用windows 2008有一年多了,没出现任何问题。
win7测试版也用过,不会有什么问题的,放心。
当然你最 ......
我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("数据库连接失败") ......
我用的like模糊查询,比如mysql的name中有“csdn论坛系统”这几个字,如何在 <input>中查询“csdn 系统”也能出来这个“csdn论坛系统”,我现在是查“csdn”或者“系统”都可以。谢谢各位了!不知道我这么表达 ......
由于以前没有innodb的应用经验,在配置innodb的innodb_data_file_path选项时用的是默认配置(ibdata1:10M:autoexte
nd) ,今天发现此数据库在同步主数据库数据时(此innodb是作为一台myisam db的冷备机器),ibda ......