Connecting Tech Pros Worldwide Forums | Help | Site Map

Accessing SQL Server database from Javascript

Scott Castillo
Guest
 
Posts: n/a
#1: Jul 20 '05
Is it possible to access an SQL Server database from a Javascript client? I
know you can transfer variables from middleware to Javascript client, but
was wondering if you can directly access database from client?

Thanks for any response.

Scott



Richard Cornford
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Accessing SQL Server database from Javascript


"Scott Castillo" <scasti2@cox.net> wrote in message
news:z0SWb.40310$P17.11527@fed1read03...[color=blue]
>Is it possible to access an SQL Server database from a Javascript
>client? I know you can transfer variables from middleware to
>Javascript client, but was wondering if you can directly access
>database from client?[/color]

Javascript as a language has no knowledge of or interest in databases.
Javascript is used in order to script an object model and any facilities
for database access and the like would have to be provided by the object
model being scripted. Common browser object models do not include a
mechanisms for accessing databases. There are mechanisms that can be
used but most would come under your category of "Middleware". But it is
questionable whether it would be a good idea for database access to be
initialised with javascript as there is little that can be done to
prevent access to the source code, and any reader of the source code may
gain access to enough information to take advantage of, or deliberately
damage, the database.

Richard.


Scott Castillo
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Accessing SQL Server database from Javascript


Thanks for the reply.

I was thinking that in a very simple scenario, the security could perhaps be
taken care of somehow with a little thought. But seeing as how its not
possible, I'll stop thinking about it.


"Richard Cornford" <Richard@litotes.demon.co.uk> wrote in message
news:c0gs32$klr$1$8302bc10@news.demon.co.uk...[color=blue]
> "Scott Castillo" <scasti2@cox.net> wrote in message
> news:z0SWb.40310$P17.11527@fed1read03...[color=green]
> >Is it possible to access an SQL Server database from a Javascript
> >client? I know you can transfer variables from middleware to
> >Javascript client, but was wondering if you can directly access
> >database from client?[/color]
>
> Javascript as a language has no knowledge of or interest in databases.
> Javascript is used in order to script an object model and any facilities
> for database access and the like would have to be provided by the object
> model being scripted. Common browser object models do not include a
> mechanisms for accessing databases. There are mechanisms that can be
> used but most would come under your category of "Middleware". But it is
> questionable whether it would be a good idea for database access to be
> initialised with javascript as there is little that can be done to
> prevent access to the source code, and any reader of the source code may
> gain access to enough information to take advantage of, or deliberately
> damage, the database.
>
> Richard.
>
>[/color]


Douglas Crockford
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Accessing SQL Server database from Javascript


> Is it possible to access an SQL Server database from a Javascript client? I[color=blue]
> know you can transfer variables from middleware to Javascript client, but
> was wondering if you can directly access database from client?[/color]

It is nuts to allow access to a database from Any client. Certifiably
insane. Not smart.
Closed Thread