Mysql to Postgresql conversion tool in Java - java

Is there a Java tool that can convert mysql dump into postgresql dump available.
Googling got me this, https://github.com/maxlapshin/mysql2postgres. Which is a ruby gem.
In my current development environment installing Ruby is not allowed.
The versions used
Mysql 5.1
Postgres 8.2
Note: mysqldump --compatible=postgresql didnt work!
Thanks.

First, PostgreSQL 8.2 is ancient and unsupported. Upgrade urgently. Read the release notes for each .0 version to find out about any compatibility issues you may face.
As for the conversion, you should generally do it in two phases. Convert and load the schema, then convert and load the data.
Generally automated tools won't do a good job converting database schemas. You should do a schema-only dump, run a conversion tool over it then hand-edit and hand-check it before loading it into PostgreSQL.
Once you have a schema that looks sane, do a data-only dump from MySQL and try loading that into a PostgreSQL instance with your converted schema loaded in it. mysqldump --compatible=postgresql may do a better job, though you'll probably need additional flags too.
If you try it and still don't have any luck, consider following up with more detail. Report exact error messages not just "doesn't work" if you follow up.

Consider downloading the advanced server and use the built-in migration toolkit.
However, you should as Craig said - upgrade to a supported version of postgresql.

Related

Java local database

I am creating a piece of software using Java and Eclipse. The software is to be freestanding and not require an internet connection.
The main use of the program requires access to database. I am used to developing for Android where there is an inbuilt MySQL database in every device. Is there a similar thing with Java. I have looked everywhere and have seen references to this kind of thing but have not seen any clear answers. I know there is JDBC, but this seems to be a method of controlling the database rather than creating it.
What I am trying to establish is, is there a pre installed database available to use in Eclipse without any further installation, in the same way as the MySQL Db is available when using Android??
The version of Java I am using is java.runtime.version=1.7.0_40-b43
and I am using Eclipse Kepler Service Release 2
What I am trying to establish is, is there a pre installed database available to use in Eclipse without any further installation, in the same way as the MySQL Db is available when using Android??
First, Android includes SQLite (not mysql). Second, No. No there is not. You could use Derby or SQLite or H2 (or any other pure Java database). As pure Java databases they don't require external installation (but they can be installed externally) and can be run directly in Eclipse.
Would SQLite work for your purposes?
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html
It's not pre-installed, but seems like it might be a good fit otherwise:
http://wiki.eclipse.org/Connecting_to_SQLite

How to save user name (simple example of jdbc) in java?

can you please give the steps how to make simple program of jdbc on mac .
I have eclipse on my mac .so I need steps what to do next so that can able to make program of jdbc ?
I do lot of RND but they provide for windows.But I also download Mysql from this link
http://dev.mysql.com/downloads/file.php?id=450342
and download workbench from this link
http://dev.mysql.com/downloads/file.php?id=412161
Then can you please may I right ?
or what next I have to do to make jdbc program ?
Install and start MySql.
Download the MySql JDBC driver. Try here: http://dev.mysql.com/downloads/connector/j/. Extract all the files and add the jar to your eclipse project.
Now you can start coding. Look up the docs for DriverManager, Statement and ResultSet.
There is not much difference at all in using a Mac than other platforms for working with JDBC.
JDK
You need an implementation of Java, a "JDK". See my answer to another question about installing Java 7 and Java 8 on a Mac, including links for downloading a JDK. Before doing the database stuff, be sure this works in the Terminal.app program: java -version
JDBC Driver
You need a JDBC driver specific to your particular database engine.
H2 Database
I suggest trying the H2 database rather than MySQL, only because it may be a gentler easier way to get started. H2 is pure Java, rather simple in terms of installing and administrating, and free-of-cost. H2 comes with its own JDBC driver. The H2 web site has a quick-start page and a tutorial page. It is not written explicitly for Mac OS X, but you should be able to "translate" as needed.
Oracle Tutorial
Then follow the JDBC tutorial provided by Oracle.
Also: StackOverflow is for specific questions on programming, not general or wide-ranging discussion.

Trying to figure out how to use EasyPHP (MySQL) with Java EE 6

I'm trying to figure out how to use MySQL with Java EE 6. I'd like to work with it locally on my machine so I can get some experience. Is it possible to do this? I've seen this MySQL Connector and I expected it to be like a class or something, but it's a lot more than that and I'm not sure about how to implement it. Can anyone offer any advice on where to get started? I did find one article that wasn't as detailed as I'd hoped, but it was from 2004 anyways, so it's no longer relevant.
The JDBC Database Access trail in the official Java documentation describes how you access databases from Java. The JDBC Basics Getting Started page says that the tutorial has been tested with MySQL.
You will need to install the MySQL JDBC driver (I presume that's what you've linked to above) and have it on your classpath in order for the database connection to work. But other than having it on your classpath, you shouldn't need to interact with any MySQL-specific classes from your code.
So basically you are using EasyPHP to stand up a MySQL instance on Windows? Seems like a little bit of overkill but in any case here is what you can do:
Download and install Jboss 7 (Full profile).
Run JBoss (/bin/standalone.bat>
Download MySQL connector for Java
Unzip, then copy the MySQL connector Jar to /standalone/deployments
Login to JBoss admin console (http://localhost:8080)
Browse to Connector/Datasources and define a new datasource pointing to your MySQL DB
Thats it for setting up a server environment. Now you can do all your JEE6 goodness in your favorite IDE and deploy the code to your Jboss server. Or you can skip all that and use the baked in goodies in NetBeans. A good tutorial can be followed here.

Prerequirements to start with JDBC

I am new to JDBC. I would like to know what I should install in my machine before starting off with JDBC. It would be most appreciated if you can also give me links to find them.
read the tutorial first.
http://download.oracle.com/javase/tutorial/jdbc/index.html
Besides a working database, all you need is the JDK and the database-specific JDBC driver. You'll need to find and download the driver for the database you're going to use.
If you want to learn JDBC and don't care about a specific database, I can recommend HSQLDB, which is a lightweight DB that you can run on your machine or even from your process.
And I agree with qrtt1's advice - the best place to start is Sun/Oracle's JDBC tutorial.
Read "Before you Begin" in this JDBC Tutorial; for use with any JDBC Database, including Oracle, PostgreSQL, MySQL, etc.
Pretty much all you need is:
JDK 1.6 or greater installed and ready to go.
A text editor.
A JDBC Database Driver contained in products such as MySQL or PostgreSQL

How to tell if Oracle Streams is installed?

I am just setting up a test project using Oracle Streams.
My first problem is, is there something I need to install first? How can I tell if Oracle Streams is installed ?
Streams is automatically included in Oracle 9.2 Enterprise Edition and up. You may need to take additional steps to configure your instance to use Streams, however. This presentation covers a lot of the steps of configuration: http://www.scribd.com/doc/123217/Oracle-Streams-Step-by-Step-PPT
What version of oracle? It comes installed by default from at least 10g.

Categories