Pretty sure he is using the backup command.


> Here's the code:

             String sqlStatement = "BACKUP TO ?";
                    try (Connection connection = getConnection())
                    {
                        try (PreparedStatement preparedStatement =
           connection.prepareStatement(sqlStatement))
                        {
                            preparedStatement.setString(1, fileName);
           preparedStatement.executeUpdate();
                            if (isDebugEnabled)
                            {
                                logger.debug("BACKUP TO result completed");
                            }
                        }
                    }




On 5/09/2014 8:46 PM, Thomas Mueller wrote:
Hi,

> to do a test after the backup and copy to make sure the database can be opened.

Testing a backup is a good idea in any case (even for regular backup). However, just opening the database will not detect some types of errors. You would need to do a complete read (for example using "script"). But if you do that, wouldn't it be simpler and faster to use the built-in online backup feature (the "backup" SQL statement)?

Regards,
Thomas



On Fri, Sep 5, 2014 at 9:03 AM, witerat <johndhutche...@gmail.com <mailto:johndhutche...@gmail.com>> wrote:

    Copying an active data file creates and inconsistent image. This
    is writes by the data  engine occur randomly throughout the file,
    while reading from the file is done serially. Essently later
    writes nearer the beginning of the file that the reading point of
    the copy operation are not reflected in the copied image.


    On Friday, 5 September 2014 05:02:25 UTC+12, Kam wrote:

        Testing the backup sounds like a good idea. thanks. Still not
        sure what would cause a corrupt db because if it happens while
        its in use, then this is not a solution but it's a start.

-- You received this message because you are subscribed to the Google
    Groups "H2 Database" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to h2-database+unsubscr...@googlegroups.com
    <mailto:h2-database+unsubscr...@googlegroups.com>.
    To post to this group, send email to h2-database@googlegroups.com
    <mailto:h2-database@googlegroups.com>.
    Visit this group at http://groups.google.com/group/h2-database.
    For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com <mailto:h2-database+unsubscr...@googlegroups.com>. To post to this group, send email to h2-database@googlegroups.com <mailto:h2-database@googlegroups.com>.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to