Index: trunk/mwdumper/src/org/mediawiki/importer/SqlServerStream.java |
— | — | @@ -3,6 +3,7 @@ |
4 | 4 | import java.io.IOException; |
5 | 5 | import java.sql.Connection; |
6 | 6 | import java.sql.SQLException; |
| 7 | +import java.sql.SQLWarning; |
7 | 8 | import java.sql.Statement; |
8 | 9 | |
9 | 10 | public class SqlServerStream implements SqlStream { |
— | — | @@ -20,6 +21,7 @@ |
21 | 22 | Statement statement; |
22 | 23 | try { |
23 | 24 | statement = connection.createStatement(); |
| 25 | + statement.setEscapeProcessing(false); |
24 | 26 | statement.execute(sql.toString()); |
25 | 27 | } catch (SQLException e) { |
26 | 28 | throw new IOException(e.toString()); |
— | — | @@ -29,6 +31,8 @@ |
30 | 32 | public void close() throws IOException { |
31 | 33 | try { |
32 | 34 | connection.close(); |
| 35 | + } catch (SQLWarning e) { |
| 36 | + e.printStackTrace(); |
33 | 37 | } catch (SQLException e) { |
34 | 38 | throw new IOException(e.toString()); |
35 | 39 | } |
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperGui.java |
— | — | @@ -59,7 +59,10 @@ |
60 | 60 | ":" + port + |
61 | 61 | "/" + // dbname + |
62 | 62 | "?user=" + username + |
63 | | - "&password=" + password; |
| 63 | + "&password=" + password + |
| 64 | + "&useUnicode=true" + |
| 65 | + "&characterEncoding=UTF-8" + |
| 66 | + "&jdbcCompliantTruncation=false"; |
64 | 67 | System.err.println("Connecting to " + url); |
65 | 68 | conn = DriverManager.getConnection(url); |
66 | 69 | connected = true; |
— | — | @@ -159,6 +162,7 @@ |
160 | 163 | reader.readDump(); |
161 | 164 | stream.close(); |
162 | 165 | } catch(IOException e) { |
| 166 | + e.printStackTrace(); |
163 | 167 | gui.setProgress("FAILED: " + e.getMessage()); |
164 | 168 | } |
165 | 169 | running = false; |