newbie: JDBC query exception: "SQL0204 *tablename* in *username* type FILE not found"

Posted on 2006-05-05
Last Modified: 2007-12-19
This error doesn't make sense to me, and makes me think that I'm doing something silly when connecting to my database.  Everything compiles just fine, and the connection seems to go fine (as far as I can tell) until my retrieveData procedure throws an exception that says "BLLOPER in MYUSERNAME type *FILE not found".  BLLOPER is the table name targeted by my SELECT query, and MYUSERNAME is the username I use in the Connection string to log in.  I wouldn't expect to find a table in a username.  I'm not sure why Java does.  Probably something to do with my Connection string, but if I really knew what I was doing, I wouldn't be begging for help here.

Code is cribbed heavily from:
Connection string partially derived from:

import java.sql.*;

public class TestDBDriver {
static Connection con;
static Statement stmt;
static ResultSet rs;
static DatabaseMetaData dmd;

public static void main(String[] args) {
} //main

static void loadDriver() {
try {
} catch(java.lang.ClassNotFoundException e) {
      System.err.print("ClassNotFoundException: ");
} //try
} //loadDriver

static void makeConnection() {
String url = "jdbc:as400://;database name=MYDBNAME";
String user = "MYUSERNAME";
String pwd = "MYPWD";
try {
      con = DriverManager.getConnection(url, user, pwd);
} catch(SQLException ex) {
      System.err.println("database connection: " + ex.getMessage());
} //try
} //makeConnection

static void retrieveData() {
try {
stmt = con.createStatement();
rs = stmt.executeQuery(opSQL);
while ( {
      String s = rs.getString("ODESC");
} //while
} catch(SQLException exrd) {
      System.err.println("retrieve failed: " + exrd.getMessage());
} //try
} //retrieveData
} //class
Question by:Rakafkaven
    LVL 4

    Author Comment

    Changing opSQL to read "SELECT ODESC FROM MYDBNAME.BLLOPER" changes my error message to "[SQL0204] BLLOPER IN MYDBNAME type *FILE not found", which at least makes English-language sense to me:  can't find table in database.  Not sure why that changes anything, or why the database name in my Connection url didn't do this anyway... but whatever.

    Still, a new and exciting variation on the same error is not a solution.  Any input would be greatly appreciated.
    LVL 4

    Author Comment

    Fixed.  Thats the error you get when you spell your table name incorrectly.  Painfully obvious, but the weird mention of the username in the error was throwing me.  Anyone who can explain why that happened still gets the points.
    LVL 14

    Expert Comment

    > Thats the error you get when you spell your table name incorrectly
    each table will be stored as a file also on some DB there is a separate file for table schema.
    this is whay you get *tablename* in *username* type FILE not found
    LVL 14

    Expert Comment

    also it could be spelled that the there is no table with the specified name in this username account

    LVL 23

    Accepted Solution


    Your Database is using DatabaseName.TableName format to index i.e to look out for your table this varies from database to database.

    >>String url = "jdbc:as400://;database name=MYDBNAME";

    here your database name is not a part of your url as it it self is a another satement. i.e the above statement is equal to

    String url = "jdbc:as400://;
    database name=MYDBNAME";

    if you  just wanted to mention your table and wanted to make yourdatabase name a part of the url then check out

    Thank You.

    LVL 4

    Author Comment

    Thanks everyone!

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Java: Convert List<Object[]> to List<MyBean> 3 34
    wordsCount challenge 10 49
    dividesSelf challange 15 59
    network + 7 57
    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now