• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing CONNECT USER command with executeUpdate

 
Vav Priya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..i'm a beginner jdbc and jsp. i got struck with this while doing my assignment.
here is my code snippet -

Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","SYSTEM","hr");
Statement st=con.createStatement();
int a=st.executeUpdate("Connect USER "+uname+" / " +pwd);
if(a==0)
out.println("connected");
else
out.println("cannot connect");


can i use the 'connect user' command in this way?
if yes, what does the executeUpdate method return here actually?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've moved this to the JDBC forum as it is not a JSP question.

Moreover, as a beginner in JSP you should know that putting Java code in a JSP is an obsolete and discredited practice that has been phased out for over 13 years. Be aware that modern JSP does not put Java code in JSP pages, but uses proper web application structures, and takes advantage of the EL (Expression Language) and JSTL (JSP Standard Tag Library) to keep the JSP pages Java-free.

I recommend novices to JSP read
  • The Secret Life of JSPs
  • The Front Man
  • .
     
    Vav Priya
    Greenhorn
    Posts: 7
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Bear Bibeault wrote:I've moved this to the JDBC forum as it is not a JSP question.

    Moreover, as a beginner in JSP you should know that putting Java code in a JSP is an obsolete and discredited practice that has been phased out for over 13 years. Be aware that modern JSP does not put Java code in JSP pages, but uses proper web application structures, and takes advantage of the EL (Expression Language) and JSTL (JSP Standard Tag Library) to keep the JSP pages Java-free.

    I recommend novices to JSP read
  • The Secret Life of JSPs
  • The Front Man
  • .


    thank u..
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic