[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Accessing the database  XML
Forum Index » Mango M2M 1.12.5 and Earlier general discussion
Author Message
Coldwind

Initiate

Joined: 26/05/2008 03:32:16
Messages: 7
Offline

Hi!
Im playing around a bit with inserting multiple points by uploading a tab-separated datafile. What is the easiest and most secure way to access the database?
Best regards!
/Joakim
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1850
Offline

The embedded database (Derby) is configured to be single-user only, so you can only access it with Derby tools when Mango is not running. However, there is the SQL page within Mango that lets you run arbitrary SQL statements.

Best regards,
Matthew Lohbihler
Dusan

Initiate

Joined: 30/05/2012 12:40:20
Messages: 15
Offline

Hi,



when I deploy project on Tomcat, and access it in Web browser, the watchlist is empty,
although I created data points in Eclipse (when run it on Tomcat Runtime Environment).

Any idea?


Thank you very much,

Dusan
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1850
Offline

You've created two separate Derby databases i assume. Check the env.properties for the database location.

Best regards,
Matthew Lohbihler
Dusan

Initiate

Joined: 30/05/2012 12:40:20
Messages: 15
Offline

This is content of src/env.properties:


#db.type=mysql
#db.url=jdbc:mysql://localhost/scadabr
#db.username=root
#db.password=
#db.pool.maxActive=10
#db.pool.maxIdle=10

db.type=derby
db.url=~/../../bin/scadabrDB
db.username=
db.password=

convert.db.type=
convert.db.url=
convert.db.username=
convert.db.password=

api.authentication=disabled
api.username=admin
api.password=admin

#security.hashAlgorithm=NONE
grove.url=http://mango.serotoninsoftware.com/servlet



What do I have to change?



Thank you very much

Dusan
Dusan

Initiate

Joined: 30/05/2012 12:40:20
Messages: 15
Offline

And also, could explain me briefly why there are two databases? When are they used?
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1850
Offline

You have two databases because the propery "db.url=~/../../bin/scadabrDB" resolved too two different locations depending on how you started Tomcat.

Best regards,
Matthew Lohbihler
Dusan

Initiate

Joined: 30/05/2012 12:40:20
Messages: 15
Offline

Ok. Now, I am completely confused.

First to say, I use ScadaBR, so some urls are different.

I set Tomcat Runtime Environment in Eclipse, so I can run Mango inside Eclipse.

As I understood, Mango use only Deby database.

1. When I run Mango inside Eclipse, and for example add new user, where I can access (Derby) database
to see new user parameters? Where is database located?



Thank you very much

Dusan
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1850
Offline

When you start Mango with Derby as your configured database, the first thing it does is try to find an existing database at the configured location, in this case db.url=~/../../bin/scadabrDB". This is a file system path. If the database is not found, a new one is created. It would seem that, depending on how you start Mango, the database path resolves to two different locations, which is why you have two different databases.

Best regards,
Matthew Lohbihler
Dusan

Initiate

Joined: 30/05/2012 12:40:20
Messages: 15
Offline

I realized that Eclipse creates scadabrDB somewhere in workspace, so when I copy it to Tomcat/bin, it works. Thank you!

2. I always used phpMyAdmin (on Wamp server) for sql databases monitoring. Can I connect Mango with phpMyAdmin somehow?




Thank you very much

Dusan
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1850
Offline

If you use MySQL, sure. But Derby is a single-user system, so you can't connect with Mango running. (I also don't know if phpMyAdmin would be able to connect to a Derby DB at all.) But there is always the SQL console within Mango itself.

Best regards,
Matthew Lohbihler
 
Forum Index » Mango M2M 1.12.5 and Earlier general discussion
Go to:   
Powered by JForum 2.1.9 © JForum Team