可视化sqlite数据库schemaspy

时间:2012-12-13 22:42:03

标签: java sqlite graph schema

我想要可视化sqlite数据库。有几个页面讨论了这一点,但这些解决方案都不适用于我Good tool to visualize database schemaeasy visualisation using sqlfairySchemaDisplay。似乎问题出在SQLite.JDBCDriver上。这是关于java and sqlite的讨论,但我无法弄清楚。我所做的是将sqlite-jdbc-3.7.2.jar重命名为sqlite.jar,希望这有所帮助,但你可以看到运气不好。

[pista@HP-PC schemaspy]$ ls -l
total 7084
drwxrwxr-x  3 pista pista    4096 Dec 12 22:34 javasqlite
drwxrwxr-x  2 pista pista    4096 Dec 12 22:05 lib
drwxrwxr-x 14 pista pista    4096 Dec 12 22:15 mendeley
drwxrwxr-x  2 pista pista    4096 Dec 12 22:13 out
drwxrwxr-x  2 pista pista    4096 Dec 12 22:05 properties
-rw-rw-r--  1 pista pista    2655 Feb 22  2009 README.TXT
-rw-rw-r--  1 pista pista  248945 Aug 16  2010 schemaSpy_5.0.0.jar
-rw-rw-r--  1 pista pista  161441 Dec 12 22:04 schemaSpyGUI20090302.zip
-rw-rw-r--  1 pista pista      26 Nov  4  2007 schemaSpyGUI.bat
-rw-rw-r--  1 pista pista  102299 Mar  2  2009 schemaSpyGUI.jar
-rw-rw-r--  1 pista pista      86 Nov 18  2007 schemaSpyGUI.sh
-rw-rw-r--  1 pista pista  284954 Dec 12 22:25 sqlite-dll-win32-x86-3070701.zip
-rw-rw-r--  1 pista pista 3201128 Dec 12 22:28 sqlite.jar
-rw-rw-r--  1 pista pista 3201128 Aug 27  2010 sqlite-jdbc-3.7.2.jar
drwxrwxr-x  3 pista pista    4096 Dec 12 22:05 src
drwxrwxr-x  2 pista pista    4096 Dec 12 22:31 xerial
drwxrwxr-x  7 pista pista    4096 Dec 12 22:31 xerial-sqlite-jdbc-e0fd4e05a97e
[pista@HP-PC schemaspy]$ java -jar schemaSpy_5.0.0.jar -t sqlite -u pista -o out/ -db mendeley/wakatana@gmail.com@www.mendeley.com.sqlite 
Using database properties:
  [schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/sqlite.properties
java.lang.ClassNotFoundException: SQLite.JDBCDriver

Failed to load driver 'SQLite.JDBCDriver'from: [file:/home/pista/schemaspy/sqlite.jar]

Use the -dp option to specify the location of the database
drivers for your database (usually in a .jar or .zip/.Z).

我做错了,这是一种好方法吗?

2 个答案:

答案 0 :(得分:7)

我能够让sqlite使用schemaspy命令行工具。我使用了sqlite jdbc驱动程序:

https://bitbucket.org/xerial/sqlite-jdbc

我的sqlite.properties文件如下所示:

description=SQLite
connectionSpec=jdbc:sqlite:<db>
db=database name
driver=org.sqlite.JDBC
#you may need to put the full path to the driver depending on your setup
driverPath=sqlite-jdbc-3.7.15-M1.jar
selectTablesSql=.tables

答案 1 :(得分:1)

JDBC驱动程序类是org.sqlite.JDBC,而不是SQLite.JDBCDriver。

我建议您尝试SchemaCrawler for SQLite,这是一个免费的开源数据库文档工具。 ScheiteCrawler for SQLite下载捆绑了更高版本的SQLite JDBC驱动程序3.7.8,并且不需要额外重命名jar。

Sualeh Fatehi,SchemaCrawler