Is the syntax of Oracle 10g and MySQL the same?
They're vastly different when it comes to other features, such as security, programming languages, data types, tools, end user support, requirements, etc.

However, they're both compliant with basic SQL92 (and perhaps other SQL standards), so one can do the same basic schema creation and data querying and manipulation. You should be able to do the basics from java applications without noticing where you're connected to (and this applies to several other databases).