jsp页面:
sqlstr= "where a.status=1 ";
String[][] jbcj= ld.getValues("Pt_activities a","a.Act_id","sqlstr");
javabean:private String[][] getValues() throws JavaBeanException
     {
             Connection conn = null;
             PreparedStatement pstmt = null;
             ResultSet rs = null;
             int rowCount = 0;
             try
             {
               conDataBase connData=new conDataBase();
               conn = connData.getPool().getConnection();//dataSource.getConnection();                     if (whereClause == null)
                             pstmt = conn.prepareStatement("SELECT COUNT(*) FROM " + tableName);
                     else
                             pstmt = conn.prepareStatement("SELECT COUNT(*) FROM " + tableName + " " + whereClause);                     rs = pstmt.executeQuery();
                     if(rs.next())
                       rowCount = rs.getInt(1);
                     rs.close();
                     pstmt.close();
                     
                     if (whereClause == null)
                             pstmt = conn.prepareStatement("SELECT " + firstFieldName + " FROM " + tableName);
                     else
                             pstmt = conn.prepareStatement("SELECT " + firstFieldName + " FROM " + tableName + " " + whereClause);                     rs = pstmt.executeQuery();
                     
                     int cnt;
                     int field = 1;
                     for (int k =0;k<firstFieldName.length();k++)
                     {
                       cnt = firstFieldName.indexOf(",",k);
                       if (cnt != -1)
                       {
                           field = field + 1;
                           k = cnt;
                        }
                     }
                     String[][] values = new String[rowCount][field];                     for (int i = 0; i < rowCount; i++)
                     {
                       try{
                           if (rs.next()) {
                             for (int m =0;m<field;m++)
                             {
                              String a = rs.getString(m+1);
                              if (a!=null)
                                values[i][m] = a;
                              else
                                values[i][m]="";
                             }
                           }
                         }
                         catch(Exception e)
                         {
                           break;
                         }
                     }                     return values;
             }
             catch(SQLException e)
             {
                     throw new JavaBeanException(e.getMessage());
             }
             finally
             {
                     if (rs != null)
                             try { rs.close(); rs= null;} catch(SQLException ignore) {}
                     if (pstmt != null)
                             try { pstmt.close(); pstmt= null;} catch(SQLException ignore) {}
                     if (conn != null)
                             try { conn.close(); conn= null;} catch(SQLException ignore) {}
             }
        }
不知道为什么如果再查询语句中将表名from Pt_activities a这么写就会报ORA-00933: SQL command not properly ended 错误,如果直接from Pt_activities 就没问题