\r
**%VERSION%** ([zip](http://code.google.com/p/iciql/downloads/detail?name=%ZIP%)|[jar](http://code.google.com/p/iciql/downloads/detail?name=%JAR%)) *released %BUILDDATE%*\r
\r
+- Fixed password bug in model generator (issue 7)\r
+\r
+**1.1.0** *released 2012-08-20*\r
+\r
- All bulk operations (insert all, update all, delete all) now use JDBC savepoints to ensure atomicity of the transaction\r
\r
**1.0.0** *released 2012-07-14*\r
import java.util.HashSet;\r
import java.util.List;\r
import java.util.Map;\r
-import java.util.Properties;\r
import java.util.Set;\r
\r
import javax.sql.DataSource;\r
throw new IciqlException(e);\r
}\r
}\r
+ \r
+ public static Db open(String url, String user, char[] password) {\r
+ try {\r
+ Connection conn = JdbcUtils.getConnection(null, url, user, password == null ? null : new String(password));\r
+ return new Db(conn);\r
+ } catch (SQLException e) {\r
+ throw new IciqlException(e);\r
+ }\r
+ }\r
\r
/**\r
* Create a new database instance using a data source. This method is fast,\r
return new Db(conn);\r
}\r
\r
- public static Db open(String url, String user, char[] password) {\r
- try {\r
- Properties prop = new Properties();\r
- prop.setProperty("user", user);\r
- prop.put("password", password);\r
- Connection conn = JdbcUtils.getConnection(null, url, prop);\r
- return new Db(conn);\r
- } catch (SQLException e) {\r
- throw new IciqlException(e);\r
- }\r
- }\r
+ \r
\r
/**\r
* Convenience function to avoid import statements in application code.\r
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Writer;
-import java.sql.Connection;
-import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.List;
import java.util.regex.Matcher;
public static void execute(String url, String user, String password, String schema, String table,
String packageName, String folder, boolean annotateSchema, boolean trimStrings)
throws SQLException {
- Connection conn = null;
try {
- conn = DriverManager.getConnection(url, user, password);
Db db;
if (password == null) {
db = Db.open(url, user, (String) null);
} else {
- db = Db.open(url, user, password.toCharArray());
+ db = Db.open(url, user, password);
}
DbInspector inspector = new DbInspector(db);
List<String> models = inspector.generateModel(schema, table, packageName, annotateSchema,
}
} catch (IOException io) {
throw new SQLException("could not generate model", io);
- } finally {
- JdbcUtils.closeSilently(conn);
}
}