what is the difference between connecting h2 by http://localhost:8080/h2-console vs clicking h2 icon - jpa

well i was confused because i coudn't find tables in DB. i used JPA and saw DDL queries.. i figured this problem by connecting h2 by requesting url "http://localhost:8080/h2-console"
the reason i failed was because i tried to connect h2 by clicking h2 icon like this.
i searched a lot but coudn't figure out the reason of issue. what is the difference between these two ways of connecting h2. can you guys tell me the reason of issue related with difference?

Most likely you have a separate H2 Server process and its icon in the system tray opens a H2 Console attached to the server, and you also have an embedded H2 Console servlet in your application. They look similar, but they aren't related to each other.
If your application uses an embedded persistent or in-memory database, you don't need that server process, it isn't used by application.
But if your application uses a JDBC connection URL like jdbc:h2:tcp://localhost/… or jdbc:h2:ssl://localhost/…, you need that separate server.

Related

Setting up Cygnus-PostgreSQL for historical data persistance

Now that I have a real device (LWM2M -using wakaama implementation) running and sending data to Orion (I can confirm from server log, 'Observers created successfully'), I want to proceed with historical data storage.
I am not sure how to start. Using docker-compose file to start all services. I already have postgres image pulled and running. Would like to use it for persistence.
I guess I need to create the db schema to use for storage, any link to cygnus-postgres installation/persistence would be appreciated.
Should anyone be looking for how to go about similar situation as I did (above refers), I found the explanations here the customisations section very helpful, please read it.

How do you get data from a remote MySQL database into your app?

Have just finished a couple of tutorials regarding populating a SQLite database with data and then using this data within your app.
However none of these tutorials show how to connect to a remote server in order to obtain data.
QUESTION:
How do you get data from a remote MySQL database into your app??
What options do you have?
Remote access is not a good idea, you would have to allow everyone to access it since it's an app. The best way to go about this is to build a layer between your app and database. From the app you would access a server side script which does the database work and responds to your app.
Well there are methods to allow remote access to your mysql database on your server and being able to query the database remotely. I think this is the cleanest solution. Check out this link: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

how to connect database using uLink MMO with RPC

I am new on Unity and uLink MMO.
I am developing 3D game. In this project I need to connect mySQL database.
I have done the database connectivity using following method.
1. Made web service in C#.net. This is returning me data in Json format. Database connection string is in web service.
2. Read the Json output using Unity C# file.
Now I want to connect database using uLink+RPC.
Is there any way to connect database using RPC (without web service and uGameDB).
Please tell me the step or over all scenario to connect database using uLink + RPC.
Thanks in advance.
Regards
Bharat
All database communication with mySQL should be done
asynchronously, otherwise your game server will pause until it gets an answer
and the server's frames per second (FPS) will drop to zero until the database gives an answer.
How you make it asynchronous is up to you. Just make sure the Unity server's main thread
isn't stopped while it waits for the database to reply.
As long as you stick with mySQL you could try one of these solutions.
Use the asynchronous API for mysql. Use MySQL Connector/Net.
The Asynchronous API is described here:
http://mysql-connector-net.sourcearchive.com/documentation/6.1.2-1/classMySql_1_1Data_1_1MySqlClient_1_1MySqlCommand.html
Start one or several threads to handle the communication with mysql. This way you can use several parallel "normal" connections to mysql without stopping the main thread in Unity. The hard part is to implement the callbacks when the answer arrives from the database.
None of these ways are without challenges.
We (Muchdifferent, makers of uLink) might publish some examples of how to do solution nr 1 in the future, but at the moment we are focusing on releasing uGameDB instead.
/David

Client Server Applications for Iphone

I have a question regarding this topic.Like for Client Server Applications
1) is it necessary to load database directly into the Application.
Suppose if I have a DB in the back end and My application has to connect to that DB and display the results on the View for this do I need to Add DB into the Application directly.
2) can we access any DB or a File on the Remote server and show the required results.( with out adding that particular DB or A File into the application directly). How can we do this.
I saw a similar question in stackoverflow one answer was to use a PList, I am new to this.I am browsing the net but not able to get clear results. I lost many of my interviews because of this question.
Thanks,
1) is it necessary to load database
directly into the Application.
Suppose if I have a DB in the back end
and My application has to connect to
that DB and display the results on the
View for this do I need to Add DB into
the Application directly.
I'm not sure I understand this question. No, you don't need to load a database directly into a client in a client-server architecture. Normally, when I think of a design where a server has a database, I imagine there's some kind of way for the client to query the server for information. Perhaps it's making HTTP requests, which the server parses into a query, runs the query, and then returns the results (perhaps in XML form?).
2) can we access any DB or a File on
the Remote server and show the
required results.( with out adding
that particular DB or A File into the
application directly). How can we do
this.
Are you asking if it's possible, in general, to access a server database from a client? Yes, of course. (See above, re: HTTP Requests).
Any arbitrary file? That depends on how the server is set up. Again, HTTP is one protocol works that way; if you send an HTTP query like "GET someimage.png HTTP/1.0", the server could just be grabbing the whole file someimage.png and sending it back in the response. (Technically, it's not necessarily snarfing a whole file -- it could be creating that PNG dynamically since there's nothing in the HTTP protocol that says it must be sending an existing file -- but that's outside the scope of your question.)
I lost many of my interviews because
of this question.
Not to sound too snarky, but interviews are often won and lost not because you don't know the answer, but when you can't communicate effectively. You haven't phrased your question(s) here particularly well.

Problem to accessing Mysql remote database

First m very sorry!! for that i m asking question again related to accessing data from server.
i am new in iphone and am making a application in which require to access mysql database which is hosted on remote server,
I take a server and create our database on the server
so i have URL of the server,User Name,Password,Port Number.
I make a servlet for accessing data from the server database and generate the xml file.
I make my application and with the use of xml parser i use the data in my application.
but problem is this,
where i put my servlet which give xml file when required in my application,
On the Server?
In the Application?
i m confuse how i use servlet in my application.
If u have any reference or source code then please suggest.
Thanks,
Arun
It probably would be better to put it in the application so that your reducing the need to call the server for the details.