1245 byte By
abilal71 at 2007-9-26 6:15:41
Hi all:I am reading the comma delimited file but it only reads the first record. It does not read the second and third record.Comma Delimited File: Technology Knowledge;Database;GuptaGuptaTechnology Knowledge;Database;OracleOrcTechnology Knowledge;Database;INFORProgram Snippet: File myFile = ...
Is there a way in Java to add context information to a currently running thread?By this, I mean adding objects to a thread so that as the thread runs, any piece of code in the current or related object can access those objects. Specifically, I am trying to design a database framework. Each ...
2493 byte By
rchiu2 at 2007-9-26 6:17:06
dear all,I have writted the javabeans as follows. It has complied error. Could you point out?import java.util.currency;import java.lang.class;public class Input {private Double in-material, in-dept, in-quantity;private Currency in-unitprice, in-amount, in-cal-price;private String in-unit, ...
245 byte By
manwanis at 2007-9-26 6:17:42
As we know ResultSet is an Interface, and an Interface is one which has abstract methods.My Question is where methods like .next(), .getString(), etc are defined.thank you in advance!sunil manwani
My OS is Mandrake 8.0 , i download freetds-0.52.i386.rpm and using rpm -i installthis rpm to /usr/local/freetds , then i write this 2 line in my java program String JDriver="com.internetcds.jdbc.tds.Driver";String connectionURL="jdbc:freetds:sqlserver://my server ip:1433/Newsbut it still show ...
My OS is Mandrake 8.0 , i download freetds-0.52.i386.rpm and using rpm -i installthis rpm to /usr/local/freetds , then i write this 2 line in my java program String JDriver="com.internetcds.jdbc.tds.Driver";String connectionURL="jdbc:freetds:sqlserver://my server ip:1433/Newsbut it still show ...
HelloI am trying to query a MS Access database using the servlet container provided by tomcat. Sometimes the query has no problem in executing itself...but I keep getting a general error on my tomcat display:java.sql.SQLException: General errorat ...
Hi I was trying to make a jdbc-odbc connection to transfer data from an excel file to oracle and the query is "Select Term,Definition from [Sheet1$]"Most of it works fine except for the fact that the number of characters obtained in the second string (Definition) is restricted to 255 chars , ...
HiI am trying to check for records being available in my table based upon which i want to do an update or insert.To check for this i tried getting row count for that conditioni got the row count in a variable. then if rowcount > 0 then i proceed with update or else i try the insert.But the ...
is there any way to find no of rows in resultset without looping through it
438 byte By
rvy2k at 2007-9-26 6:23:20
Hi,I have a Java program that enters information in a database but one of the field of the database has to be more than 255 char. The data has mail information (among other stuff) and a mail message may be lenghty (at least more than 255 char).I am currently using MS Access and I was wondering ...
5900 byte By
abilal71 at 2007-9-26 6:23:40
Hi guys: Can anybody help me I am calling a store proc into my JAva program, first my store proc got parameters that I am passing to the String Tokenizer class. The problem I am having is that only one record gets added to the database but the rest of them don't. Also my log file is coming out ...
Does anyone know of any way to allow an input String representing a date to be converted to a Date object without knowing the format of the date ahead of time? How would any of you handle the case where you want to let users input any date format that Java recognizes (Dec 1, 2001; 12/01/2001; ...
878 byte By
nouha at 2007-9-26 6:25:03
Hi allI get the following error ' No more data to read from socket' when I run the program belowimport java.sql.*;import java.io.*;public class simple{ public static void main (String args[] ) throws SQLException, IOException{try {Class.forName ("oracle.jdbc.driver.OracleDriver");}catch ...
459 byte By
zariostr at 2007-9-26 6:25:13
HelloWhat i need to write in variable CLASSPATH for connection to MySQL ?i have driver mm.mysql.jdbc-1.2b, i unpack it to C:\MySQL\JDBCDrvin my autoexec.bat i haveSET CLASSPATH=%CLASSPATH%;.;"C:\MySQL\JDBCDrv\mysql_uncomp.jar"when my program is running it's throw next ...
585 byte By
gchua-ay at 2007-9-26 6:25:15
For example, you have several tables (TableA, TableB, TableC...TableN) that have the same structure.Ex.CREATE TABLE TableA(idVARCHAR(5),name VARCHAR(20) )CREATE TABLE TableB(idVARCHAR(5),name VARCHAR(20) )And you want to create a stored procedure in Oracle that can be used for all of the tables ...
Hi,i am using one stored procedure to get a set of records.i am getting it by mapping those things with java.sql.Array. And after that i am getting the values as ResultSet from that Array. The same thing is working fine in Windows platform. If i posted those thing into Unix - AIX, i am facing ...
HelloI'm programming a Java based messenger system using JDBC in the server application. I use MySQL with "mm.mysql" as JDBC driver.So far so good. There is no problem loading the driver, connecting the database or executing queries. But I want to know how many rows a custum ResultSet object ...
247 byte By
lovin_v at 2007-9-26 6:27:31
Hi Experts,I am new to EJB Transactions, can any one send me resources of transactions. Some examples which would show different type of transactions. I have a presentation tommorow. Please help me. Lovin.v
385 byte By
mortoza at 2007-9-26 6:27:36
Hello thereI want to use same jdbc code for different databases like MS Access, SQL server, Oracle, DB2 etc. But in case of logical data type fields (trye/false) in table I am facing problem in compatibilty. because it is being defined differently in sme databases.Is there anybody who can help ...
Finally I have my MySQL JDBC driver working.As I'm starting to developp Nokia applications, I had Forte for Java installed, J Wireless stuff and many others.Too much, nothing was working!I've uninstalled everything, then re-downloaded SDK2and installed in c:\sdkI've re-downloaded the ...
1038 byte By
d_piper at 2007-9-26 6:29:25
If you want to pass a String into MS SQL Server that contains an apostrophe, you must modify the string so that it has double apostrophes (''). If you pass the string in using a typical SQL statement in JSP the DBMS recognizes the double apostrophe and modifies it back into a single ...
755 byte By
lml919 at 2007-9-26 6:29:45
I can execute a select command correctly by setCommand() and execute() of CachedRowSet.but ,If the comand is "delet ...." or "update ...",a strange problem occured: the command correctlyalso execute ,However , an Exception occured at the same time :java.sql.SQLException:invalid SQL statement. ...
155 byte By
mortoza at 2007-9-26 6:30:14
Hello thereis it possible connecting databases without having jdbc or jdbc-odbc driver? anybody has any idea or thought?mortoza
116 byte By
khiz_eng at 2007-9-26 6:31:02
Can anybody suggest me as how to use Tomcat with MySQL server.Thanks in advance.Khiz_eng
361 byte By
teka at 2007-9-26 6:31:07
What are the new classes like ConnectionPoolDataSource, PooledConnection, etc. for in JSDK 1.4?Where does one get an instance of one (ConnectionPoolDataSource)? And is there some standard way for connection pooling in JSDK 1.4 ?Is there any more documentation available on the JSDK 1.4 features ...
Using odbc to access an MS Access database I have found that if you execute a prepared statement which does an update then call getMoreResults() (to check no extra results returned) then execute the statement again (after resetting parameters) then after the second execute getUpdateCount() ...
hi,i am trying to INSERT a row into a test table with two columns c1 and c2 of varchar type using updatable resultset, but it gives me NullPointerException if the test table is empty and ArrayIndexOutOfBoundsException if the table is not empty.import java.sql.*;import java.io.*;class dbtest{ ...
HiI was trying to make a jdbc-odbc connection to transfer data from an excel file to oracle and the query is "Select Term,Definition from [Sheet1$]"Most of it works fine except for the fact that the number of characters obtained in the second string (Definition) is restricted to 255 chars , and ...
I have 3 questions:1) Do you know any good JDBC connection pooling libraries? Maybe one that doesn't need much setup? Something free that I can bundle with my .WARs ?2) What characters I need to intercept in a user's input before I can put them in a database? (besides ' and %)3) Is ...
...doing in a code like this:ResultSet friends=...executeQuery...while (friends.next()) { log.append(friends.getString("sendergsm")); }somewhere in between that loop, or sometimes the loop runs out fine, and sometimes it throws SQLException called General Error. Not guite normal... ...
715 byte By
Dmazzuca at 2007-9-26 6:34:46
Suppose we have the following code:Connection con = DriverManager.getConnection(url, "login","pass");con.setAutoCommit(false);//.. inserts/updatescon.commit();I wonder if the following situation may happen:1- the con.commit() starts execution successfully;2- the RDBMS commits successfully;3- ...
i have a java command line application which runs on a unix box. in this app, i have to connect to 2 different oracle databases.initially, i attempted connecting to these databases with the oracle thin driver, but it would only connect to one of the databases. so...i decided to use the oracle ...
645 byte By
rchiu2 at 2007-9-26 6:35:28
Dear all,I want to ask you about the JDBC problems. If I have installed Jbuilder 4.0 in windows 2000 advanced server, I have the program in Jbuilder (JSP and Javabeans) to access the database which is Microsoft access 2000. Does I need to install JDBC-ODBC of access in JBuilder or it is ...
Hi, I am new to java, so please excuse me if this is a silly question, but here goes:I am created a tag library with a bunch of tags in it. Basically all of these tags will perform various database queries through JDBC, so every class (which implements a tag) will have one or more methods which ...
132 byte By
mortoza at 2007-9-26 6:36:59
Hi i found this driver on the net for free. is there anybody can share the experience using this driver?mortoza
60 byte By
lml919 at 2007-9-26 6:37:12
How to get the row Count of a ResultSet
926 byte By
rabbitxu at 2007-9-26 6:37:23
Hello all: I read samples inc:/bea/wlserver6.1/samples/examples/ejb/base/beanManaged/AccountBean.java.and getConnection() function code : initCtx = new InitialContext(); DataSource ds = (javax.sql.DataSource) initCtx.lookup("java:comp/env/jdbc/demoPool"); return ds.getConnection();It use JNDI ...
I am storing prepared statement objects in a static hashtable.This is done in order to reuse the prepared statement objects. there is one prepared statement object corresponding to each sql statement, These object resides in the memeory . One such object(corresponding to particular sql ...
408 byte By
buatapa at 2007-9-26 6:39:14
I have a app that uses threads to read and write data through sockets. These threads also keep using the connections from the connection pool to write data to database. When I try to do a close() on all of the connections at runtime, I got a exception shown below:java.sql.SQLException: Io ...
Since I'm not using EJBs, I have to manually create connection pooling...What's the best library you have ever used that creates application-wide (.war) connection pools?Is it free? Can I deploy it in my .war in the WEB-INF/lib folder?I'm using MS SQL Server and MySQL, but I need a library ...
207 byte By
r_rrao at 2007-9-26 6:40:45
Can anybody help pleasei dont know how to retreive an image from a image database and send to the printer.The image is stored in the database in cells ( not as a path to a file).
618 byte By
nadala at 2007-9-26 6:41:08
Hi, I'm having trouble when reading data with characters "Á", "É", "Ñ" from a database. If I use this:stmt = this.conexion.createStatement (); it works fine, but of course cannot access the records in the ResultSet but with method next ().As I wanted to use absolute (), ...
HI.It is possible to declare an input&output parameter, using CallableStatement class?I want to declare an input&output parameter to pass it to a stored procedure.Thanks.Daniele.PS: Excuse me for my english.
Hi.This is the code of my stored procedure:procedure sample_inout(i1 in varchar2, io1 in out varchar2, ritorno out varchar2) asbeginio1 := i1 || io1;ritorno := 'PEPPINIELLO VOGATORE';end;and this is the code of my program:Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");Connection ...
When a driver uses a properties objectto get a connection, it may feel free to add some properties to this object.This affects me as I use the properties object as a key in a hashtable.....
428 byte By
waellena at 2007-9-26 6:43:01
Hi EveryoneI am using Visual J++, and accessing an SQl Server database. I am using this bit of sql:String sql = "Select AppID from MyApplication where ID =" +rs.getField("ID").getString();I got an error message, it is not recognising +rs.getField("ID").getString();I know it is a problem of ...
Does anyone have experience in doing conversions on numbers (SSN, phone numbers, etc). An ideal solution would incolve a class that could take a String and some type of format String (###-##-#### or (###)###-####) and apply that format to the String if possible?
320 byte By
decaynan at 2007-9-26 6:44:34
When i complie the code there was no error but while exe this exception is thrown!!!!I am using JDK 1.3.1, JWSDK 1.0.1 and Oracle 8iError: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection. Error: 500Internal Servlet Error: ...
hii am getting java.sql.SQLException: General error: Access denied for user: '@192.168.0.104' to database 'Drishtee'exceptioni am using mmsql driver although when i try to connect test database provided by mysql it gets connectedalso when i try to connect to System database mysql i ...