Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: how do i in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3651 of 3800
Post > Topic >>

Re: how do i insert into databse?

by Robert Kochem <robert@[EMAIL PROTECTED] > Feb 16, 2008 at 03:49 PM

mak1084@[EMAIL PROTECTED]
 schrieb:

> [code]
> String str1 = "select roll_no from student where sem_id = (select
> sem_id from subject where course_id ='bsc_it' and sub_id =
> '"+getsub1+"')";

Please don't forget that creating SQL queries with user specified input
incor****ates the possibility for an SQL injection attack. Therefore I
strongly recommend to change your code to use a PreparedStatement and set
the parameters via setInt() or SetString() - then your WebApp is secure
against such attacks.

http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

Robert
 




 2 Posts in Topic:
how do i insert into databse?
mak1084@[EMAIL PROTECTED]  2008-02-16 06:14:22 
Re: how do i insert into databse?
Robert Kochem <robert@  2008-02-16 15:49:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:53:21 CDT 2008.