-1

I have html document (one file) for calling google map.

It works with this part of code in html:

var locations = [
  [ -33.890542, 151.274856],
  [ -33.923036, 151.259052],
  [ -34.028249, 151.157507]
]

var marker, i;

for (i = 0; i < locations.length; i++) {  
  marker = new google.maps.Marker({
    position: new google.maps.LatLng(locations[i][0], locations[i][1]),
    map: map
  });

But I would like to make connection in that html file to the database DB2 on my server 192.168.0.67 with port 50005 and username db2user password db2pass

My database is MAXIMO, and TABLE is TICKET. Attributes are LAT and LNG with this values (there can be more than 3 values for locations variable)

Can someone help me how to create connection and to retrieve that values for locations for all records from TICKET table?

Thanks

Veljko
  • 1,708
  • 12
  • 40
  • 80
  • making a connection to a DB from html is generally frowned upon. See [MVC](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) – phanneman Mar 26 '12 at 21:31
  • Is the question asking how to connect to a database via HTML? No server-side tech? – Whymarrh Mar 26 '12 at 21:36
  • Yes i would prefer connection via HTML but OK and PHP will suite...because it will be only file which I will upload to the server. I would like to test it first on my localhost machine and then I would like to upload that file on the actual server ( web sphere application). But and my localhost and actual server will be able to make database connection and to retrieve values – Veljko Mar 26 '12 at 21:52

1 Answers1

0

You need to change the file extension to .php to do this, then see:

http://www.w3schools.com/php/php_mysql_connect.asp

MultiDev
  • 10,389
  • 24
  • 81
  • 148
  • Thanks for answer I did some things with MYSQL before. but is it same and for DB2? There are no differences for DB2 database? – Veljko Mar 26 '12 at 21:55