0

I am trying to do a homework assignment in a database course that requires me to use sqlj. It is supposed to make a connection to a SQL database running on my computer. When copying and pasting the example code into Netbeans I get a compile error:

package sqlj.runtime does not exist: import sqlj.runtime.*;


import java.sql.*;
import java.io.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
import oracle.sqlj.runtime.*;

public class A10Q1 {

public static void main(String[] args) {
    DefaultContext cntxt = oracle.getConnection("url", "user", "pswd", true);
    }

}

I changed the inputs on the getConnection function.

user207421
  • 305,947
  • 44
  • 307
  • 483
Alex
  • 1
  • 1
  • How are you building your program - eg are you using maven, or just running `javac` yourself ? – racraman Oct 07 '19 at 00:17
  • Just running it on Netbeans – Alex Oct 07 '19 at 17:49
  • Just researching SQLJ, unfortunately looks well obsolete (it’s even too old for Java8 - see https://stackoverflow.com/questions/36260631/is-there-any-java-8-supported-release-of-sqlj ). If the course wants you to use it, they should supply the jar libraries - probably in the same directory as the “sqlj” preprocessor command) and you’d add those to your classpath. Is this a course that you found (eg online) and decided yourself to take ? If so, personally I would find another one :) – racraman Oct 07 '19 at 23:55

0 Answers0