Search Unity

u3d and database

Discussion in 'Scripting' started by Williams, Nov 14, 2009.

  1. Williams

    Williams

    Joined:
    Nov 14, 2009
    Posts:
    2
    how can i use u3d to access to database(such as oracle)?
    which class or function?
    please help me!!
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity does not offer such functionality.
    But Mono does, check out System.Data and especially check out what is present out of the box in Mono 1.2.5 and what you need to drop in (the corresponding dynamic libraries for the database system is required for sure).

    This all assumes you are using a standalone distribution. Web Distributions can't use non .NET assemblies (and a db access wouldn't be a good idea there anyway as the webplayer is executed locally not on the server, thus making your db vulnerable due to the remote access)
     
  3. nemo1992

    nemo1992

    Joined:
    Nov 6, 2009
    Posts:
    13
    Joining, since it's a vital topic especially for a Web Player deployment. It is possible to run a JS code on the page from the Web Player, so it would be possible to establish db connection.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    That will not work.

    Unity as JS run on the client machine not on the server and you would want a lot but definitely no db connection from the enduser to your db.
    What you optimally would use is WWW and WWWForm and request the informations from a php / asp / irev / cgi handling backend.
     
  5. Williams

    Williams

    Joined:
    Nov 14, 2009
    Posts:
    2
    i realized it via www&wwwform yesterday
    and use aspx page as the server.