This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Comparing large BIGINT fields in MySQL on Windows

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble comparing large BIGINT fields in a MySQL database on Windows. I have an SQL query which performs a '>' comparison between a BIGINT field and a literal number value. When I perform this query from within my Java code I get no results. When I perform the same query from the MySQL command line everything works fine (which is the correct behavior for these numbers). The literal is being passed into my prepared statement using the setLong() method. The numbers I'm dealing with are on the order of 13 digits, so they should fit nicely within the BIGINT structure. But all I can figure is that the number is getting mangled somehow.

It should be noted this same Java code works great on Linux and Mac OS X. It only fails on Windows.

Help?

Details:
Windows XP Pro, SP3
MySQL 5.1
 
author
Posts: 4173
29
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's see your Java code. In general ">" should be fine no matter where you use it.
 
Joseph Dixon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some code to illustrate my problem. Notice the comparison "modified > ?" on the second line of the query. As stated in my previous message, this code works fine on both Linux and Mac OS X. It only fails on Windows.

 
Scott Selikoff
author
Posts: 4173
29
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you mentioned Windows as a potential cause of the issue, have you considered updating your lower_case_table_names setting in your MySQL config. It's possible the query is having trouble with the case of table names, especially if your accessing it on multiple platforms.
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic