• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wanted: Sample JDBC 4 with SQL Annotation

 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to run the sample code in "A Tutorial Java 6 New Features" by Budi Kurniawan page 167. The code for the book is available at http://books.brainysoftware.com/download/jdk6Samples.zip. Chapter 8 is the database chapter.

Neither the java command line javac nor the java6 compiler used by eclipse can find the class java.sql.DataSet.

What do I have to do to make to compile the following code?

Better yet, does someone have some sample JDBC4 code that demonstrates using annotations for SQL queries (insert, delete, select, update etc...) that compiles and runs?

I did some google searching and found some JDBC4 tutorials, but the code fragments did not include the import statements!

I was told that the only low cost database that includes a JDBC4 driver is IBM's Apache Derby. Is this true?

Thanks,
Siegfried

package jdbcDemo;
import java.sql.Connection;
import java.sql.DataSet;
import java.sql.DriverManager;
import java.sql.SQLException;

public class QueryDemo {

}
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have looked in the J2SE and J2EE APIs and there is no sign of a Dataset class. Please check carefully that it really is java.sql.DataSet you are looking for.
The Apache Derby database is usually included with Java 6 SDK downloads.
 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, OK, how about an example that uses that new feature where you specify the SQL in an annotation? Can someone point me to a working example of that feature?

Thanks,
Siegfried
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic