Does Attach work for datbases in plugin routines. Can I attach a second database? Can I have a database open and still query the World Datbase is the requirement.
SQL command Attach
-
- English
- angriff
- Thread is marked as Resolved.
-
-
Yes, at least when using SQLite, you can use the ATTACH and DETACH statements, for example:
Java
However, usually it's fine to just establish an new connection to the 2nd database It's safe to have multiple connections to different database simultaneously, e.g.:
Just remember to close() the database connections if you don't need them anymore.If you want to access the world database btw, it's highly recommended to use the built-in WorldDatabase (since there are issues with thread-safety in SQLite). When using the WorldDatabase, all commits are synchronized.
Example to use the WorldDatabase:Java -
Thanks .. just read about the attach in an SQL tutorial and could not find anything directly about that but was going to try to see if that was needed I need a third party UID from the database while using another database to keep track with an event.
this kind of support makes it fun.. thanks
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!