Hi,
There are 1652487 rows in my table in MYSQL. I want to copy all the values corresponding to one field into a file. I wrote a java program in netbeans using jdbc driver for this. I'm unable to do this at one go. Is there a way out ? < Is there any limit on the number of rows one can select >
[ EDIT ]
my code : action performed when a button is pressed :
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
try
{
File fo=new File("D:\\dmoz_externalpages.txt");
FileWriter fro=new FileWriter(fo);
BufferedWriter bro=new BufferedWriter(fro);
Connection con=null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dmozphp","root","");
PreparedStatement ps=con.prepareStatement("select externalpage from content_description");
ResultSet rs=ps.executeQuery();
while(rs.next())
{
bro.write(rs.getString(1));
bro.newLine();
bro.flush();
}
}
catch(Exception e)
{
System.out.println(e);
}
}
when i run this , i get the following exception :
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space