Jspx is being tested against MySQL DB. DataTable worked fine with normal quires like
However, with quires like this,
SELECT (g.NAME) AS g_name, (m.NAME) AS m_name,
(CASE c.gender
WHEN 1
THEN 'male'
WHEN 2
THEN 'female'
ELSE c.gender
END
) AS c_gender,
c.*
FROM dcs.customer c, dcs.grade g, dcs.martial_status m
WHERE c.grade = g.ID
AND c.martial_status = m.ID
AND ID = custid
AND passport_num LIKE '%pass%'
AND NAME LIKE '%custName%'
AND phone LIKE '%custPhone%'
AND gender = custgender
AND TRUNC (creation_date) >= str_to_date ('from_date', '%d/%m/%Y')
AND TRUNC (creation_date) <= str_to_date ('to_date', '%d/%m/%Y')
AND job LIKE '%custJob%'
AND grade = cutgrade
AND martial_status = custmart
AND deleted = custdel
we noticed that it could not retrieval the full columns returned. To know the reason, let's dive under the Hood, while JSPX is executing the search SQL, it constructs a hashmap of the returned records
public static List<Hashtable<String, DataField>> search(String datasource, String sql, int start, int size) throws Exception
where the DataField is storing the column name , type and value. The hash map representing one record of the result set is indexed by the column name.
Inside the above method, the column name is retrieved as
if (resultSet.absolute(start + 1))
{
int colCount = resultSet.getMetaData().getColumnCount();
do
{
cols = new Hashtable<String, DataField>();
for (int i = 1; i <= colCount; i++)
{
fieldName = resultSet.getMetaData().getColumnName(i).trim().toLowerCase();
cols.put(fieldName, new DataField(fieldName, resultSet.getObject(i)));
}
rows.add(cols);
}
while (resultSet.next() && (++counter < size));
}
The method getColumnName(i) in MySQL JDBC driver returns the original name of the column instead of the alias name in the SQL statement, so assume you have table Customer with column "NAME" and you have table JOB with Filed "NAME".
Creating aliasing for the filed "NAME" in JOB Table as "JOB_NAME" will return the column "NAME" from JOB table under the label "JOB_NAME". But JSPX will get "NAME" as the name of the column.
Instead of this method we used the getColumnLabel(i) method to get the correct name of the column.
longchamp outlet, nike air max, jordan pas cher, prada handbags, oakley sunglasses, chanel handbags, polo ralph lauren outlet online, louis vuitton outlet, air max, longchamp outlet, nike air max, polo outlet, cheap oakley sunglasses, tiffany and co, louis vuitton outlet, ray ban sunglasses, nike outlet, kate spade outlet, nike free, louis vuitton, louis vuitton outlet, tiffany jewelry, jordan shoes, longchamp outlet, oakley sunglasses, ray ban sunglasses, louboutin pas cher, louis vuitton, sac longchamp pas cher, burberry pas cher, christian louboutin uk, ugg boots, tory burch outlet, uggs on sale, polo ralph lauren, christian louboutin outlet, gucci handbags, nike free run, oakley sunglasses wholesale, ray ban sunglasses, longchamp pas cher, christian louboutin, christian louboutin shoes, michael kors pas cher, replica watches, replica watches, oakley sunglasses, prada outlet, nike roshe
ReplyDeletehollister, beats by dre, vans, mont blanc pens, valentino shoes, gucci, giuseppe zanotti outlet, vans outlet, reebok outlet, hermes belt, babyliss, celine handbags, wedding dresses, nike roshe run, chi flat iron, oakley, iphone cases, soccer shoes, converse outlet, new balance shoes, ralph lauren, nike air max, p90x workout, nike air max, mac cosmetics, longchamp uk, lancel, nike trainers uk, ray ban, ferragamo shoes, nike huaraches, soccer jerseys, north face outlet, lululemon, louboutin, jimmy choo outlet, baseball bats, nfl jerseys, insanity workout, asics running shoes, herve leger, hollister, north face outlet, abercrombie and fitch, ghd hair, bottega veneta, mcm handbags, timberland boots, instyler, hollister clothing
ReplyDeletecurry 7 sour patch
ReplyDeletesupreme
hermes birkin
adidas stan smith shoes
golden gooses
kyrie spongebob
longchamp handbags
michael kors
supreme t shirt
off white clothing
goyard outlet
ReplyDeletebape hoodie
kyrie 8
goyard outlet
jordan shoes
palm angels
kyrie spongebob
bape shoes
jordans shoes
air jordan