Results 1 to 1 of 1
  1. #1
    herfnai is offline Member
    Join Date
    Aug 2008
    Posts
    13
    Rep Power
    0

    Default problem in select query

    hello,query error invalid column name

    private void search(java.awt.event.ActionEvent evt) {
    try{
    String tablename=jTextField1.getText().trim();
    String d=jTextField4.getText().trim();
    ResultSet rs=stm.executeQuery("select * from "+tablename+"where name="+d); }catch(Exception e){
    JOptionPane.showMessageDialog(null,e.getMessage()) ;
    }

    please complete where clause
    Last edited by herfnai; 08-20-2008 at 05:24 PM.

Similar Threads

  1. [SOLVED] General string problem in my database query.....?
    By prabhurangan in forum New To Java
    Replies: 7
    Last Post: 06-25-2008, 08:55 AM
  2. ms access jdbc query problem
    By Fleur in forum New To Java
    Replies: 2
    Last Post: 04-30-2008, 06:55 PM
  3. Select Count
    By Apple2 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-29-2008, 09:02 AM
  4. Using a variable in a SELECT FROM WHERE query
    By cplmckenzie in forum JDBC
    Replies: 12
    Last Post: 04-23-2008, 03:24 AM
  5. JDBC select problem
    By abhiN in forum JDBC
    Replies: 0
    Last Post: 03-12-2008, 08:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •