SQLite as repository

Questions and answers regarding general SQL and backend databases

SQLite as repository

Postby log-out » Tue Jun 16, 2009 10:36 am

I'd like to use SQLite as DB repository (only for testing, for now) using this driver. Does someone know where I shoould put the db file (in which directory)?

Thanx
Log-Out
Madrid - Spain

Servoy 5.2.9 - build 1020 - SQL Server 2005
Servoy 6.0.3 - build 1223
Java version 1.6.0_29-b11 (!!)
Windows XP Professional SP3
log-out
 
Posts: 180
Joined: Sat Feb 19, 2005 4:20 pm
Location: Spain

Re: SQLite as repository

Postby ngervasi » Sat Jun 27, 2009 1:20 am

I used it only once a couple of years ago to test connecting directly to the mail database in MacOS X (it's SQlLite).
It doesn't matter where the DB is, you have to specify the path on the connection string:

jdbc:sqlite:/Users/nick/Library/Mail/Envelope Index
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: SQLite as repository

Postby Roberto Blasco » Sun Jul 03, 2011 2:22 pm

Hi all.

I'm working with sqlite to make a portable solution capable of sync with the server installed in a pendrive.

jdbc:sqlite:/Users/nick/Library/Mail/Envelope Index --> the absolute path.

What is the relative path inside servoy installation where to save the sqlite database?

something like ...

jdbc:sqlite:my_sqlite_database

Best regards. Roberto Blasco.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: SQLite as repository

Postby log-out » Thu Jul 14, 2011 10:43 am

Roberto Blasco wrote:
What is the relative path inside servoy installation where to save the sqlite database?

something like ...

jdbc:sqlite:my_sqlite_database


But that relative path is not the same in developer and in server...

I've found the solution: if you define the URL like this:

jdbc:sqlite:%%user.dir%%/my_sqlite_database

Developer and Server will search for the database in the same path (application_server directory)

Regards,
Log-Out
Madrid - Spain

Servoy 5.2.9 - build 1020 - SQL Server 2005
Servoy 6.0.3 - build 1223
Java version 1.6.0_29-b11 (!!)
Windows XP Professional SP3
log-out
 
Posts: 180
Joined: Sat Feb 19, 2005 4:20 pm
Location: Spain

Re: SQLite as repository

Postby Roberto Blasco » Fri Sep 23, 2011 11:55 am

Hi all again!

I've tried to set sqlite as repository server but when I try to upgrade it, trhows this message

!ENTRY com.servoy.eclipse.core 4 0 2011-09-23 09 begin_of_the_skype_highlighting              4 0 2011-09-23 09      end_of_the_skype_highlighting:23:40.689
!MESSAGE Failed to create/upgrade repository.
!STACK 0
com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: java.sql.SQLException: database locked
at com.servoy.j2db.server.Zc.Zn.createRepositoryTables(Zn.java:483)
at com.servoy.j2db.server.Zc.Zo.Zc(Zo.java:1261)
at com.servoy.j2db.server.Zc.Zo.Zb(Zo.java:283)
at com.servoy.j2db.server.Zc.Zo.createRepositoryTables(Zo.java:253)
at com.servoy.eclipse.team.ServoyTeamProvider$7.run(ServoyTeamProvider.java:714)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3885)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3506)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: com.servoy.j2db.persistence.RepositoryException: java.sql.SQLException: database locked
at com.servoy.j2db.server.Zc.Za.Zb(Za.java:1758)
at com.servoy.j2db.server.Zc.Za.Za(Za.java:31)
at com.servoy.j2db.server.Zc.Za.setUserProperties(Za.java:287)
at com.servoy.j2db.server.Zc.Zn.createRepositoryTables(Zn.java:320)
... 28 more
Caused by: java.sql.SQLException: database locked
at org.sqlite.DB.execute(DB.java:270)
at org.sqlite.DB.executeUpdate(DB.java:281)
at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.servoy.j2db.Za.Za.Zf.invoke(Zf.java:8)
at $Proxy1.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPrepar
edStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at com.servoy.j2db.server.Zc.Za.Zb(Za.java:1018)

Do I need to configure sqlite previous to set the repository_server?

Best regards. Roberto Blasco.

Windows 7
SQLite
Servoy 5.2.9
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: SQLite as repository

Postby juan.cristobo » Fri Sep 14, 2012 12:46 pm

Could you use SQLite as repository, finally?
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am

Re: SQLite as repository

Postby Roberto Blasco » Sun Sep 16, 2012 12:48 am

Hi juan.cristobo

No, I couldn't :(

Now I'm using bundled posgresql instead, just in developer mode of course.

Best regards. Roberto Blasco.
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: roberto.blasco.serrano@gmail.com
User avatar
Roberto Blasco
007
 
Posts: 355
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 8 guests