This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DATABASE_URL=jdbc:postgresql://localhost/$(whoami) | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/init.d/mysql stop | |
Shutting down MySQL.. | |
# mysqld_safe --skip-grant-tables --skip-networking & | |
[1] 4983 | |
# Starting mysqld daemon with databases from /var/lib/mysql | |
# mysql mysql | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 to server version: 5.0.21-log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PreparedStatement preparedStatement = connection.prepareStatement(sql); | |
for (int i = 0; i < 1000; i++) { | |
preparedStatement.setObject(1, someValue); | |
preparedStatement.addBatch(); | |
if ((i + 1) % 100 == 0) { | |
preparedStatement.executeBatch(); | |
} | |
} | |
preparedStatement.executeBatch(); | |
preparedStatement.close(); |
NewerOlder