Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JDBC Error

  1. #1
    Banned
    Join Date
    May 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default JDBC Error

    Hi guys,

    I am currently trying to select a variable from my database and keep receiving error. Any suggestions?

    at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(SQLServerException.java:196)

    I could swear that the SQL Statement is correct. Are there any jars I should be aware of? This same exact statement works in a different classpath. I am using Eclipse and JDK5.

    Statement stmt = construct_db.createStatement();
    String sqll ="SELECT TRANSACTION_ID FROM TRANSACTION WHERE JOB_ID="+this.getJobId();
    ResultSet rs = null;
    int transactionId = 0;
    try{
    stmt.executeQuery(sqll);
    while(rs.next())
    {
    transactionId = rs.getInt("TRANSACTION_ID");
    }
    catch (SQLException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,823
    Thanks
    55
    Thanked 2,344 Times in 2,315 Posts

    Default Re: JDBC Error

    Can you post the full text of the error message?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. JDBC Too Many Connection Error
    By sajithgsm in forum JDBC & Databases
    Replies: 1
    Last Post: February 22nd, 2012, 05:08 AM
  2. JDBC Problem - com.mysql.jdbc.Driver
    By icu222much in forum Java Servlet
    Replies: 2
    Last Post: November 21st, 2011, 11:54 PM
  3. JDBC Error in servlet
    By shuklagirish in forum Java Servlet
    Replies: 2
    Last Post: May 30th, 2011, 09:13 AM
  4. JDBC connection error
    By nrao in forum What's Wrong With My Code?
    Replies: 7
    Last Post: November 11th, 2010, 12:43 PM
  5. Connecting to Cache through JDBC - error
    By javavick in forum JDBC & Databases
    Replies: 0
    Last Post: May 6th, 2010, 07:34 AM