 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
snehalapatil@gmail.com Guest
|
Posted: Wed Feb 15, 2006 10:12 am Post subject: link DB record through browser... |
|
|
Hi all,
I have a remote sybase database,I want to display links in web page
(browser) such that when user clicks on link ,actual record in that
sybase database table should be opend.
i.e. I want to connect actual database record to my web page through
Hyperlink.
So my question is ... how should I build the link?
thanks,
-Snehal. |
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Wed Feb 15, 2006 12:12 pm Post subject: Re: link DB record through browser... |
|
|
On 15 Feb 2006 01:59:24 -0800, "snehalapatil (AT) gmail (DOT) com"
<snehalapatil (AT) gmail (DOT) com> wrote, quoted or indirectly quoted someone
who said :
| Quote: | I have a remote sybase database,I want to display links in web page
(browser) such that when user clicks on link ,actual record in that
sybase database table should be opend.
i.e. I want to connect actual database record to my web page through
Hyperlink.
So my question is ... how should I build the link?
|
you send a cgi-like request to your servlet womb that does the lookup.
A more dangerous way is to invoke an applet that opens a JDBC
connection.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching. |
|
| Back to top |
|
 |
David Harper Guest
|
Posted: Thu Feb 16, 2006 8:12 am Post subject: Re: link DB record through browser... |
|
|
snehalapatil (AT) gmail (DOT) com wrote:
| Quote: | Hi all,
I have a remote sybase database,I want to display links in web page
(browser) such that when user clicks on link ,actual record in that
sybase database table should be opend.
i.e. I want to connect actual database record to my web page through
Hyperlink.
So my question is ... how should I build the link?
|
The link will need to include some piece of information that identifies
the record uniquely.
This could be the primary key of the table, which is usually an integer,
so your link might look like
http://www.example.com/myapp/getrecord.php?id=1234
There's one drawback with this method, though. Hackers will quickly
figure out that 1234 is a primary key in the underlying database, and
they will try substituting other numbers in order to access other
records in your database. You probably don't want them to do this.
To solve this problem, add another column to your table, make it a
unique key, and set it to a hash of some or all of the contents of the
row. Then use that column in your link, which will look something like:
http://www.example.com/myapp/getrecord.php?id=5A6DBF67C656AD70
Your SQL query will now select using the hash value, which looks like
random text. Hackers won't be able to guess the hash values of other
records, because they don't know what data went into calculating the hash.
I'm not familiar with Sybase, but MySQL has server-side functions for
hashing strings using algorithms such as MD5, and I'm guessing that
Sybase provides this kind of thing too.
David Harper
Cambridge, England |
|
| Back to top |
|
 |
snehalapatil@gmail.com Guest
|
Posted: Fri Feb 17, 2006 12:12 pm Post subject: Re: link DB record through browser... |
|
|
So I have to write another script "getrecord.php" to display record?
Is there is any direct method ....provided dy browser or dbms?
thanks,
-snehal. |
|
| Back to top |
|
 |
David Harper Guest
|
Posted: Fri Feb 17, 2006 8:12 pm Post subject: Re: link DB record through browser... |
|
|
snehalapatil (AT) gmail (DOT) com wrote:
| Quote: | So I have to write another script "getrecord.php" to display record?
|
Yes.
| Quote: | Is there is any direct method ....provided dy browser or dbms?
|
Your web browser never communicates directly with the DBMS.
The web browser sends a request to the web server, and the web server
runs the PHP script (or Perl script or Java servlet) which sends a query
to the DBMS.
David Harper
Cambridge, England |
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Sat Feb 18, 2006 2:12 pm Post subject: Re: link DB record through browser... |
|
|
On Fri, 17 Feb 2006 19:11:35 GMT, David Harper
<devnull (AT) obliquity (DOT) u-net.com> wrote, quoted or indirectly quoted
someone who said :
| Quote: | Your web browser never communicates directly with the DBMS.
The web browser sends a request to the web server, and the web server
runs the PHP script (or Perl script or Java servlet) which sends a query
to the DBMS.
|
It can in theory. It is considered highly dangerous though to expose
your JDBC api to the Internet.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|