I'm trying to write a Java function for my DB2 database.
When my class is in SQLLIB/Function all is working great.
Now i need to change the path of the class to another ... |
I get the following exception at times:
com.ibm.db2.jcc.b.gm: [jcc][t4][2030][11211][3.50.152] A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream. ... |
How to make SQLExceptions thrown by DB2 JDBC driver more descriptive?
Currently I am getting this kind of exceptions. It is cumbersome to work with these cryptic SQLCODE and SQLSTATE numeric values. ... |
I am trying to execute a stored proc in java.
I know I have to connect to database and do the stuff....
But the thing is How do I know that if that ... |
I have created a j2ee project using:
1)DB2 (as database server)
2)WAS-CE server to deploy the application
3)eclipse to code.
as was-ce server is running too slow I want to change to any other server.
my ... |
Having gotten an answer to a Java problem I had last week (thanks!), I'm now on to a new problem with DB2... The Java app I'm working on takes data ... |
I want to compare content of 15 columns in two rows.
I am using db2 9 with jdbc.
Can I use a sql to get a result like "match or not match"
And ... |
|
I have the following class loaded into DB2 9.7.4 Express-C for generating ids for rows
public class Int64UUID {
public static final long dx = 30*386*12*30*24*3600*1000; // starting ...
|
I am using command db2licm -l in batch file to check the installation of DB2 express c edition on local system.
I have made a regular expression in java that search for ... |
I have an application consisting of: Spring, WebSphere, accessing DB2 jdbc.
Everything is set up ok, the application is usually published, because when I go to select a seat at any table ... |
I have to make DB2 connection in java using port number.
Is there any command in DB2 or any way that can get the DB2 port number?
I have not used the default ... |
Hi I am trying to serialize an object into the db2. The column name on my table for the object is type blob. I do the followings to write to the db: ByteArrayOutputStream output = new ByteArrayOutputStream(); ObjectOutputStream OutputStream = new //pc is my object ObjectOutputStream(output); OutputStream.writeObject(pc); byte[] pcByte = output.toByteArray(); I then pass pc Byte to my stored procedure where ... |
Thanks Ray I converted their code to db2 drivers and it almost compiles but I get a "Type expected" error on the System.out.println !! I don't think I've seen this error on this statement, any suggestions ? and from others it seems I need to install db2 connect on my server which I'm doing now. |
My project needs to access DB2 using JDBC. It runs on different machine (Unix, Solaris) from DB2 (AIX). After unix administrator installed DB2 client software and modified the global profile (adding db2profile there), I can run a stand-alone program to access DB2. However, if I integrate the program into a web application and run it from browser, it can't load jdbc ... |
|
Hi, I just want to retrieve the table name associated to a column ( for sql orders with multiple tables ) with DB2. However, it always returns "". However, the values and column names are retrieved correctly. I tried to prefix everything in my sql orders : ( select table_name.field_name from schema.table_name ). It always returns ""! Is there a problem ... |
|
|
19. DB2 JDBC coderanch.com |
I running an nt client w/ IE 5.x, apache web server, JRUN, and DB2 on an OS/390. I have a data truncation problem when inserting a row into a column defined as a VARCHAR(3000). Only 255 out of 1000 bytes is being inserted. Any ideas... [This message has been edited by Monty Ireland (edited December 14, 2001).] |
|
I had a problem with my DB2 program so I uninstalled it and reinstalled. Before removing it I backed up my database, but now I can't restore it in the new installation as it is looking for backup history that is no longer there after removing it. How can I create a database from a backup file in a completly dif ... |
Sorry for that, I updated the displayed name. I have stored serialized object to the db as BLOB, I know it is not a good way to do it, but sometimes the business logic is very complicated, if we store it as object, it will bw very easy to do it. Thanks. Adam |
|
|
|
|
|
I had a similar case when I needed to export SQL Server database to DB2. I first generated the DDL commands, and executed them on DB2, then I exported each table data into a text file, and then imported that file in DB2. I'm not sure if there is an easier way, but my trial did work. |
30. DB2 help coderanch.comHi Maria. For product related information, the best sources I 've got so far are the product manuals themselves. In Windows/UNIX/Linux platform, you can find good info on Application Building Guide, Application Development Guide and Developing Enterprise Java Applications. In the Mainframe you have the Application Programming Guide and Reference for Java, which covers installation, administration and even SQLJ. In Java ... |
Hi Sushil. I don't think so. What is in the table doesn't get changed unless you specifically command to do so. I believe up to V7, DB2 just stores the timestamp value and no related time zone for conversions. In other words, it know only what timestamp value is in the column, but has no clue of what time zone you ... |
hi, How to re-create db2 sample database?? In FirstStepts I got this error: The database alias "SAMPLE" already exists in either the local database directory or system database directory. SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705 but in db2command window i got this error: db2 => connect to sample SQL1013N The database alias name ... |
I want to connect to a DB2 OS/390 V6 database through DB2Connect V8. I get a connection, but in the ControlCenter I cannot see the tables. In the CommandCenter I can get the tables via a "Select-Statements". Also I can`t get the Tables in WSAD 5.0. So is there a problem with DB2 OS/390 V6 and DB2 Connect V8? Or do ... |
Hi friends i am using 1>I am using IBM DB2 ODBC Driver 7.01.00.00 DB@CLI.dll the problem is i cannot use the cursor & record set types other then the default one .I thing the driver supports only JDBC1.0.So can any one suggest where I can get driver for DB2 which supports JDBC2.0 2>The other point for which I would like to ... |
|
Periodically, we have been receiving an IOException using the HIT JDBC DB2 driver HIT SW with a DB2 database connection. The message associated with IOException references a "Broken pipe". I know from my socket programming background that a broken pipe message is normally encountered when the server severs the socket connection to the client. However, the database adminstrators (at a remote ... |
|
|
|
Hi.. I'm using DB2 for a project.. I want to be able to genearate an automated PK which can just be a serial number like 1, 2,3..... So I want to know that how can i do that with DB2 Secondly, When i insert I want to know what was the PK that was genearted.. so how can i do that.. ... |
|
Hi, I am trying to execute a stored proc in DB2 using jdbc. Am getting an error on this stetement: stmt.execute(); where stmt is an instance of CallableStatement. The Error message is : COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL10013N The specified library "" could not be loaded. Where is the name of my stored proc. Note: 1)the connection is established succesfully and ... |
hello, guys: I have a question about sum function using DB2. I am using DB2 Universal Database Version 7.2 (persona; edition) on Win 2000. If I have 2 tables: create table person{ person_id char(10) not null, ..... primary key(person_id) }; create table job{ job_id char(20) not null, start_date TIMESTAMP; stop_date TIMESTAMP; person_id char(10), primary key(job_id) }; You can see from the ... |
I have a requirement like if payment_type = 's' then compensation is weekly_rate * 4 but if weekly_rate is 0 or null then compensation is 0 if payment_type = 'p' return the value in gross_amount column. Below is the decode function I have used. Would like to know how to do the same using db2 functions. Decode(payment_type, s, (decode(nvl(weekly_rate,0.00),0.00,0.00, weekly_rate*4)) ,p,gross_amount) ... |
DB2 is a database not a programming language. I'm not aware of any built in search functions. You can define a field to be a substring of another field, but I don't think that's what you are looking for. A SQL example on an i-series machine would look like this: SELECT * FROM library/file WHERE upper(field) like 'G%' Note: you do ... |
|
Hi, I have an scnairo where we need to develop an application on some freeware database like,MYSQL or Postgres and then migrate it to DB2. Now I need help in knowing which database will be more compatible with DB2,I mean to ask with respect to functions supported. also I have heard abt some limitations in sub queries by MSQL. And lastly ... |
Hi, I am not sure whether this is the right fourm to post this type question. please excuse me. while runnig this sql on db2control center i am getting sqlcode : -104 sqlstate : 42601 how to set the casecade delete and update on sinle command CREATE TABLE TEST_CD ( ORDER_DATE TIMESTAMP NOT NULL, ORDER_ID VARCHAR(16) NOT NULL , STORE_ID INT ... |
|
Jesus, There is no "Default" when it comes to database drivers. It uses whichever driver you have told it to use ( The whole Class.forName or DriverManager.registerDriver() part in your code ). So, if you want to be sure, download the latest jdbc drivers available for your version of DB2, then you'll know that you are not using a legacy/out-dated driver. ... |
|
I am inserting a row into a table in DB2 and DB2 provides an auto-generated key into the primary key column. After the insert I am retreiving that value by "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1", but the problem is how do I know that this is the ID that DB2 has generated for the above insert.. How do I ensure that no ... |
I am starting on a project and right now I am at the beginning stages of developing the database. My idea is that I want this to work within other projects. The way I decided to handle this is by creating a few DB2 tables. The driving DB2 table in this project will be the Section table with fields: (Report_Num; Sec_Num; ... |
|
|
|
|
Hai I created the table to insert a clob data as follows db2 => create table ctest(datas clob(65536)) DB20000I The SQL command completed successfully. db2 => describe table ctest Column Type Type name schema name Length Scale Nulls ------------------------------ --------- ------------------ -------- ----- ----- - DATAS SYSIBM CLOB 65536 0 Yes 1 record(s) selected. //////////////////////////////////////////// I tried the following java code ... |
Hai I created the table to insert a clob data as follows db2 => create table ctest(datas clob(65536)) DB20000I The SQL command completed successfully. db2 => describe table ctest Column Type Type name schema name Length Scale Nulls ------------------------------ --------- ------------------ -------- ----- ----- - DATAS SYSIBM CLOB 65536 0 Yes 1 record(s) selected. //////////////////////////////////////////// I tried the following java code ... |
I am making a JDBC-based application that generates sql scripts to migrate data between databases (even between db vendors). I have one for SQL2000, now I need one for DB2. The schema has foreign key (FK) constraints, so the mass import needs to shut this off before calling sql insert statements. In SQL2000, I use this command to disable FK constraints: ... |
DB: DB2 V7 I am having a concurrency issue. The web-system that I am building is for administrators. They will have the ability to change associate information. I will have a table that stores this information. The problem I am running into is: If two admins were logged in and they were making changes to the same employee. The first admin ... |
Originally posted by Bear Bibeault: "George George", Your display name must be a first and last name -- not your first name twice. Please adjust your display name to be a first and last name prior to your next post. Be advised that accounts with invalid display names are subject to removal. bear JavaRanch Sheriff |
|
i log in my mainframe environment using my user id and password .. After that i go to QMF and fire my DB2 queries... I want to read the DB2 tables , through my JAVA program..can anybody please guide on how i can od the connection to the DB2 database and what drivers are required..i am using Java 1.4 i know ... |
|
|
It's IBM, and the documentation will be there, but not all in one place. The value for each platform will be listed in the platform specific DB2 documentation. And I saw at least one case (a filed APAR, a bug) where a driver was retruning only 'DB2' when connected to zOS. Good luck. Guy |
|
Hi scott, Thanks for your time. My requirement is i need to filter out the data based on the user input, and i think this cant be acheived in view, since view didn't support the parameter. what exactly i need to do is write the stored procedure which will use the view and user input to filter out the invalid records. ... |
Hello, i have requirement where i have to do order by on the field that i give as input to the store procedure.Also i have to change the sorting direction, ASC or DESC folowing is the stored proc i tried.Although its error free and getting deployed .the result returned on execution is,not sorted as per the input i gave. CREATE PROCEDURE ... |
|
|
hi everyone and good morning i have problem , in my jsp page there is option for month and year .in the month drop down list of month it coming and in year drop down list of year it s coming . now i have to get the data from db2 based on selection of month and year .but in db2 ... |
|
import java.sql.*; import java.io.*; public class DBTry { public static void main(String s[]) throws IOException, SQLException { Connection conCopyTo = null; try { //retreive connection for DB2 String url = "jdbc:db2://localhost:50000/default"; String userId = "sajal"; String pwd = "admin"; Class.forName("com.ibm.db2.jcc.DB2Driver"); conCopyTo = DriverManager.getConnection(url, userId, pwd); System.out.println("ConvertAcc2DB2:ConCopyTo:"+conCopyTo); } catch(Exception e) { System.out.println(e); } try { PreparedStatement psc=conCopyTo.prepareStatement("Create database DBtry"); int updatec=psc.executeUpdate(); System.out.println("Database ... |
|
I am creating a servlet that executes a query and accordingly writes out the results to a table in HTML. However, I need to refine it further. I need it to build only for 20 records a page. It needs to have a NEXT and PREVIOUS button to traverse through the records and enable the user to browse accordingly. Does someone ... |
Hi All, I am getting following exception when I am trying to connect to DB2 database. I have created a datasource on WAS 6.0. Its showing me connection successful from WAS admin console. But when I am running the application, its giving following exception : 11/4/08 10:31:06:018 IST] 0000002c StaleConnecti A CONM7007I: Mapping the following SQLException, with ErrorCode -30081 and SQLState ... |
|
This is ma first db2 code using windows xp sp2 import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.*; import java.lang.*; import java.io.*; import COM.ibm.db2.jdbc.app.*; public class Type2ExampleLegacy { public static void main(String[] args) { try { // load the DB2 Driver Class.forName("com.ibm.db2.jcc.DB2Driver"); //Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); // establish a connection to DB2 Connection db2Conn = DriverManager.getConnection("jdbc:db2://localhost:50000/das","root","root"); // use a statement ... |
Hello, We are observing behaviour with our applications that would imply that a call to commit is non-blocking and simply schedules a commit at the database rather than executing it and waiting for completion. Scenario: We have two command-line applications, one launched immediately after the other, both connecting to the same DB2 database. App1 modifies data in the database, calls a ... |
|
83. DB2 coderanch.comHi, I want the query for this: I have a table called ABC where I have many columns including ABC_ID, ABC_BGN_DT, ABC_END_DT. Now this ABC_ID is a foreign key in my another table ABC_YER. This table contains values for that ABC_ID beginning from ABC_BGN_DT to ABC_END_DT(one year in each table). Now I want to query this second table(ABC_YER) for any duplicates/not ... |
|
|
|
Hey guys, I was wondering if anyone else was suffering from this. I am getting a horribly slow connection from my WinXP dev machine to the DB2 v8.1.4 database on an AIX server. On my WinXP machine I have DB2 v8.1 Client with FP 4 installed using JDBC 2.0. I am using WSAD 5.1 to do my Java dev. I can ... |
HI all I gotta DB2 C Administrative API . it's a very useful but why doesn't IBM support Administrative API for Java ? What can I do for using Administrative API in Java Language ? so, Now I am trying to make a Java Wrapper API using JNI. is that right way?? |
|
From JAVA how can I read the following element in a IBM mainframe DB2 table using DB2Connect. I need to access the 6th occurance of the data embedded within this DB2 column. The DB2 column name is G_AGCY_CO_STAT_TB It consists of 54 characters. In COBOL the DCLGEN of this 54 bytes is defined as 05 G-AGCY-CO-STAT-TB. 05 G-tab redefines G-AGCY-CO-STAT-TB occurs ... |
Sorry for the DB2/Java cross post, I was not sure who could best answer my question) Hi I am having a problem getting db tables from a DB2 mainframe over ODBC (I have to use ODBC). I connect with the below code and write out the table and column names rather than getting the correct table and column names for this ... |
DB2 on an OS/390 platform. Merant JDBC driver I am trying to execute several SQL statement in a batch mode to increase perfomance. Unfortunately, each statement can be a different type (Add, Change, Delete) to a different table so I can't use preparedStatments. I am just using the Statement object and using addbatch( ) to add them to the batch ... |
I am running the followig code against Access 2000: cr = SqlManager.singleton().executeRetrieveSQL(sql); while (cr.getResultSet().next()) { courtOrder = new CourtOrderBean(); if (cr.getResultSet().getObject("CT_BRCH_NB") != null) { courtOrder.setBranch((String) cr.getResultSet().getObject("CT_BRCH_NB")); } In this case the CT_BRCH_NB is not null so the I continue into the If-statement. When I execute the courtOrder.setBranch.... statement, I get a SQL exception "java.sql.SQLException: No data found". This same code works ... |
|
|
|
How do I display a dialog with an indeterminate progress bar while a DB2 query runs? Could anyone point me to an example or some strong docs? I learned Java about six months ago, so I'm relatively new to the language. Through searching and documentation, I've been able to find all the examples and answers I've needed so far. Now I've ... |
UsthadThegreat wrote: For my project i need to upload tutorials in pdf files and doc files to db2 and need to display them in jsp page.and also i need to insert images into db2.Please help me if u kno any of these. Thanks in advance. You know one of the most key elements of getting help in programming is to post ... |
|
Hello all , i got some exceptions in my applications,i am using jdk 1.4.2 and db2 8 . My database connection line is getting down for some time what to do . Please reply when anyone find any solution,here is the exception com.ibm.db2.jcc.b.SQLException: at com.ibm.db2.jcc.b.l.a(l.java:1469) at com.ibm.db2.jcc.a.bb.h(bb.java:541) at com.ibm.db2.jcc.a.bb.g(bb.java:443) at com.ibm.db2.jcc.a.bb.d(bb.java:276) at com.ibm.db2.jcc.a.bb.d(bb.java:90) at com.ibm.db2.jcc.a.b.a(b.java:935) at com.ibm.db2.jcc.a.b.a(b.java:450) at com.ibm.db2.jcc.a.b.a(b.java:293) at com.ibm.db2.jcc.a.b.(b.java:207) ... |