If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > com.ibm.db2.jcc.b.SqlException: SQL1013N The database alias name or database name "S

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-28-07, 06:36
mvijaimca mvijaimca is offline
Registered User
 
Join Date: Dec 2007
Posts: 1
com.ibm.db2.jcc.b.SqlException: SQL1013N The database alias name or database name "S

hi all,

i m new guy for DB2, here i written java code for database connection, i got on error like

com.ibm.db2.jcc.b.SqlException: SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705

how to rectify the error, anyone help to me...
Reply With Quote
  #2 (permalink)  
Old 12-28-07, 06:48
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Create a database named SAMPLE - or catalog the database in your DB2 instance if it already exists and is not cataloged for some reason.

You can also get an explanation for each SQL error message by issuing the following command.
Code:
$ db2 "? SQL1013"
Just replace the SQL message code with whatever you got. You can omit the trailing N, W, I, or C letter. It just classifies errors as "normal", "warning", "informational", or "critical", respectively. You can also omit leading 0's after the "SQL", e.g. SQL104 is the same as SQL0104.

In your case, you get:
Quote:
SQL1013N The database alias name or database name "<name>" could
not be found.

Explanation:

The database name or alias specified in the command is not an
existing database or the database could not be found in the
(client or server) database directories.

User Response:

Ensure that the specified database name exists in the system
database directory. If the database name does not exist in the
system database directory, then the database either does not
exist or the database name has not been cataloged.

If the database name appears in the system database directory
and the entry type is INDIRECT, ensure that the database exists
in the specified local database directory. If the entry type is
REMOTE, then ensure that the database exists and is cataloged on
the database directories of the server node.

For CREATE DATABASE with the AT NODE clause, ensure that the
database name is in the system database directory with an entry
type of INDIRECT and with a catalog node number that does not
equal -1.

Federated system users: in addition to the above, verify that
the database names specified in SYSCAT.SERVERS are all valid.
Correct any SYSCAT.SERVERS entry for which the database specified
in that entry does not exist.

sqlcode : -1013

sqlstate : 42705
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On