Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I used the jdbc-odbc bridge in Java to do just this in the past, but performance through ODBC is not great. I would suggest looking at something like <a href="http://jtds.sourceforge.net/" rel="nofollow noreferrer">http://jtds.sourceforge.net/</a> which is a pure Java driver that you can drop into a simple Groovy script like the following:</p> <pre><code>import groovy.sql.Sql sql = Sql.newInstance( 'jdbc:jtds:sqlserver://serverName/dbName-CLASS;domain=domainName', 'username', 'password', 'net.sourceforge.jtds.jdbc.Driver' ) sql.eachRow( 'select * from tableName' ) { println "$it.id -- ${it.firstName} --" // probably write to mysql connection here or write to file, compress, transfer, load } </code></pre> <p>The following performance numbers give you a feel for how it might perform: <a href="http://jtds.sourceforge.net/benchTest.html" rel="nofollow noreferrer">http://jtds.sourceforge.net/benchTest.html</a></p> <p>You may find some performance advantages to dumping data to a mysql dumpfile format and using mysql loaddata instead of writing row by row. MySQL has some significant performance improvements for large data sets if you load infile's and doing things like atomic table swaps. </p> <p>We use something like this to quickly load large datafiles into mysql from one system to another e.g. This is the fastest mechanism to load data into mysql. But real time row by row might be a simple loop to do in groovy + some table to keep track of what row had been moved. </p> <pre><code>mysql&gt; select * from table into outfile 'tablename.dat'; shell&gt; myisamchk --keys-used=0 -rq '/data/mysql/schema_name/tablename' mysql&gt; load data infile 'tablename.dat' into table tablename; shell&gt; myisamchk -rq /data/mysql/schema_name/tablename mysql&gt; flush tables; mysql&gt; exit; shell&gt; rm tablename.dat </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload