Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

the problem is unknow for me

bengesbenges Member Posts: 331
i request the data from a database with [b] ResultSet [/b] and i use the [b] getString(..) [/b] to get the value in the database, but it always return nothing, y? i'm sure my database have data and the SQL statement is correct

can someone give me a guide and idea? thanks

Comments

  • QueezyTheGreatQueezyTheGreat Member Posts: 70
    [size=1]
    : i request the data from a database with [b] ResultSet [/b] and i use
    :the [b] getString(..) [/b] to get the value in the database, but it
    :always return nothing, y? i'm sure my database have data and the SQL
    :statement is correct
    :
    : can someone give me a guide and idea? thanks
    [/size]
    Can you post some code?


    -------==[QTZ]==------
    -==[QueezyTheGreat]==-

  • bengesbenges Member Posts: 331
    [b][red]This message was edited by benges at 2002-10-19 23:45:59[/red][/b][hr]
    : [size=1]
    : : i request the data from a database with [b] ResultSet [/b] and i use
    : :the [b] getString(..) [/b] to get the value in the database, but it
    : :always return nothing, y? i'm sure my database have data and the SQL
    : :statement is correct
    : :
    : : can someone give me a guide and idea? thanks
    : [/size]
    : Can you post some code?
    :
    :
    : -------==[QTZ]==------
    : -==[QueezyTheGreat]==-
    :
    :
    my code is following:
    i found error when i execute the SQL statement like following:
    [b] s = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    boolean f = s.execute(str);
    if(f){
    ResultSet rs = s.getResultSet();
    String found="The founded record is:

    "+
    "Book Code: "+rs.getString(1)+"
    "+
    "Book Title: "+rs.getString(2)+"
    "+
    "Book Publisher: "+rs.getString(3)+"
    "+
    "Book Author: "+rs.getString(4)+"
    "+
    "Book Category: "+rs.getString(5)+"
    "+
    "Book Status: "+rs.getString(6);
    System.out.print("Result found! At: "+found);
    }
    .
    .
    .
    [/b]

    but it return to be that [b] [ODBC Drive..] Invalid cursor state [/b], why is this happen?
    some one has any idea? also, i found that eventhough my database do not have the record, but it always return true, why?
    thanks!

    also, how do i change the date format into [b] dd/mmm/yyyy [/b], cause JAVA default date format i don't have any idea to change it
    i've try to use it in JDBC to the Access database, but encounter, please do give me a guide, thank again
  • QueezyTheGreatQueezyTheGreat Member Posts: 70
    [size=1]
    : my code is following:
    : i found error when i execute the SQL statement like following:
    : [b] s = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    :ResultSet.CONCUR_UPDATABLE);
    : boolean f = s.execute(str);
    : if(f){
    : ResultSet rs = s.getResultSet();
    : String found="The founded record is:

    "+
    : "Book Code: "+rs.getString(1)+"
    "+
    : "Book Title: "+rs.getString(2)+"
    "+
    : "Book Publisher: "+rs.getString(3)+"
    "+
    : "Book Author: "+rs.getString(4)+"
    "+
    : "Book Category: "+rs.getString(5)+"
    "+
    : "Book Status: "+rs.getString(6);
    : System.out.print("Result found! At: "+found);
    : }
    : .
    : .
    : .
    : [/b]
    :
    : but it return to be that [b] [ODBC Drive..] Invalid cursor state [/b], why is this happen?
    : some one has any idea? also, i found that eventhough my database do
    :not have the record, but it always return true, why?
    : thanks!
    :
    : also, how do i change the date format into [b] dd/mmm/yyyy [/b],
    :cause JAVA default date format i don't have any idea to change it
    : i've try to use it in JDBC to the Access database, but encounter,
    :please do give me a guide, thank again
    [/size]

    Well first of I'll tell you I have never done statments like you so I
    may be wrong in what I say so be aware. Okey you asked why you get
    true when you execute the statment, well in API they say that you get
    true returned if the object returned is a ResultSet and it returns
    false if it returns a update count or if there are no results. About
    the other questions I'm sorry but I have not yet gotten that far. I'm
    sure somebody else will answer you question, I just don't want to give
    you wrong information. Hope that helps.:-)


    -------==[QTZ]==------
    -==[QueezyTheGreat]==-

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _ / http://forcoder.org / free ebooks and video tutorials about || Visual Basic .NET, Assembly, MATLAB, Ruby, Python, R, Perl, Visual Basic, Go, Scratch, C, JavaScript, Delphi, PHP, PL/SQL, Objective-C, Swift, Java, C++, C# ABAP, ML, Alice, F#, Fortran, Julia, D, Logo, Crystal, Lisp, LabVIEW, VBScript, Apex, Awk, Erlang, Transact-SQL, Clojure, Hack, Dart, Kotlin, Prolog, COBOL, Rust, FoxPro, Ada, Bash, Scala, SAS, Lua, Scheme || __

Sign In or Register to comment.