Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X

MySQL backup FAQ - How do I backup/dump a MySQL database schema?

Answer: Use the mysqldump database utility.

MySQL dump examples using the mysqldump utility

On a DOS/Windows pc with no name/password protection, you can dump a database named my_db with the following command, but don't do this just yet:

mysqldump my_db

Note that this gets you not only the database schema, but also the current data in the table.

CVS Login FAQ: Can you show me an example CVS login command?

Sure. Here's CVS login command example:

cvs -d login

This cvs login example assumes the following:

Assuming you are using Postgres (Postgresql), and:

  • you have *just* done an INSERT into a table named order,
  • the name of the sequence for that table is order_order_id_seq
  • you are using the Java programming language
  • you are still using the same database connection that you used with your INSERT statement

to get the value of the Postgres serial value just created after your INSERT statement, use some code like this:

Java JDBC / database FAQ: Where can I get a JDBC driver for Postgres/Postgresql?

Templates are code snippets that can be easily included in your Java code. The basic idea is that you type in a shortcut code, hit [Ctrl][J], and JBuilder fills in the remainder of the code. You type in a few characters, and JBuilder does the hard work for you.

CVS command FAQ: How do I know if all the changes in my CVS sandbox have been committed?

One way to do this is to move to the directory just above the module you have checked out, then run the command cvs release command. Let's look at an example:

Java FAQ: How do I multiple two integers (int) in Java?

Here's a quick example:

int i = 3;
int j = 4;
int k = i * j;
System.out.println("k = " + k);

The value of k here will be 12.

Java integer FAQ: How do I add two Java integers (Java int fields)?

Answer: Just use the Java addition operator, the plus sign (+), to add two integers together.

Here's a quick example: If you have to drive 23 miles east, then 14 miles north, what is the total distance you had to drive?