MYSQL+Servlets but how to make DSN.......?

377 byte By atti1614 at 2007-9-26 4:46:49
Hello all! I wanna use MySQL as a backend database in my Servlets. But...I found no driver while creating DSN for the databases. I m stucked ><Please guide me that how can I create data source name, so that i can be able to pass that as database URL in DriverManager.getConnection(). ...

Received [Microsoft][ODBC SQL Server Driver]Invalid parameter type

329 byte By sunjavaray at 2007-9-26 4:46:57
Hi, This error happened when I am using CallableStatementto call a stored procedure.=====================cstmt.registerOutParameter(3, java.sql.Types.INTEGER);myResultSet = cstmt.executeQuery();=====================I am sure my stored procedure is returning 'int'. ...

Getting Table Constraints.......

517 byte By aboonetlink1 at 2007-9-26 4:49:47
Hi all,Here is a requirement for me in JDBC. How do i get the information about the constraints of a table by using JDBC API?I can get the Primary Keys , Foreign Keys by using DataBaseMetaData. But i am not able to get the Checked constraints, Unique Key Constaints and all.Please help me on ...

timestamp

406 byte By sanora at 2007-9-26 4:49:54
hi everybody I want to store the current date and time in a Timestamp variable, i am retrieving the current date and time using Calendar cal = Calendar.getInstance(TimeZone.getDefault());cal.getTime();but the method of getTime() returns a date object I i need Timestamp object, How to convert a ...

JDBC PreparedStatement with Oracle 8.0.5 on Linux

980 byte By chongyp at 2007-9-26 4:50:54
As the subject stated, I am using Oracle 8.0.5 on a Linux machine.When I am using a PreparedStatement, somehow, the binded variables are reversed in order.E.g. String sql = "INSERT INTO TABLE1 (X, Y) VALUES (?, ?)";PreparedStatement ps = conn.prepareStatement(sql);ps.setString(1, ...

Urgent : MySQL Server?

120 byte By khiz_eng at 2007-9-26 4:51:57
How do I create a user and assign password for that user in MySQL?Thanks in advance.khiz_eng

Scrollable ResultSet using proc out cursor

1003 byte By kbrungs at 2007-9-26 4:52:01
We are trying to get a Scrollable ResultSet from a Stored Procedure, but the ResultSet we get is TYPE_FORWARD, no matter what I set. I have used following Code to get it: cS = conn.prepareCall("{ call IWS_KLB.Pkg_TestSelect.TestSelect4 (?) ...

Maximum Open Cursors with the CachedRowSet

1176 byte By RubelNCA at 2007-9-26 4:52:37
Hi all,I have a simple task that is cause significant headaches. I'm using the CachedRowSet to process records from an Oracle 8.1.6 database. The code simply populates the row set with records, makes changes to 2 or 3 fields in each record, then calls the acceptChanges(). When I process about ...

How to check that a RecordSet is Null?

64 byte By keithChong at 2007-9-26 4:52:51
How to check that a RecordSet is Null?thanx

SqlException: Protocol Violation problem. Please Help

1010 byte By lj75 at 2007-9-26 4:53:32
Hi:I know many people have posted this kind of problem..but I am still pretty confused as to what's going on.Basically, the situation is this: I have a bean file which accesses oracle database, and the line of code that invoked the exception seems to be the following:myConn = ...

How to handle text data separated by newline?

1971 byte By ham17151 at 2007-9-26 4:53:42
Hello. I'm querying an Access database that has a table with addess information. Unfortunately, some of the addresses consist of 2 lines (separated by newline). For example: 516 MyAddessSuite 36I'm using the getObject method of the ResultSet object. But, when I do, it creates a separate ...

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor stat

370 byte By SPasmofiT at 2007-9-26 4:53:44
Hello! Can someone help me with this error:java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state I'm running MS SQL Server 7.0 and I'm accessing it thru JDBC-ODBC.The code is quite regular (took straight from an example). Does it matter that I'm making this connection ...

Transactions in Web Tier

805 byte By mad123 at 2007-9-26 4:54:15
Hi,Can we use Transaction APIs in Web tier (Servlets and JSPs). As these days web container is also provided by lot of application servers which comes with the JTS, I was wondering whether can we simply call these APIs in the Web tier. That was my first part of question.Second part is : if not, ...

mm.mysql driver problem

362 byte By tapesorcdz at 2007-9-26 4:54:51
Hi, I'm having trouble installing the jdbc driver for mysql. After I set the class path, my simple hello world program doesn't work and neither does a load driver program. I'm on a Windows 2000 machine. What driver do I need to get i.e. (.jar)? then I just unzip and set the classpath to the ...

getProcedureColumns() and Oracle Stored Procedures

2889 byte By shobhar at 2007-9-26 4:55:00
In the following piece of code the call to getProcedureColumns() does not give me details about stored procedures but I can excute the stored procedure fine using a callableStatement.The Question I have is , what permissions need to be set on the stored Procedure in Oracle, so that the get ...

update with bind variables

568 byte By cgrey at 2007-9-26 4:55:52
I am not real familiar with jdbc accessing oracle databases.Seems if you set a string tomore than 4000 characters and try a prepared update statementyou get ORA-01704 litteral string too long. This also states youhave to use bind variables if your string is longer than 4000 characters.So I ...

Error in JavaServelts ,JRun

640 byte By skk456 at 2007-9-26 4:56:46
Hi, I am using the Oracle 8i with Java sevlets and JRUN.I am having problem with connect to the database, I am running on Win-NT. Error message:java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriverat ...

prepared statement

129 byte By varnan at 2007-9-26 4:57:07
Can we see the SQL statement inside a PreparedStatement just before it is executed,after the values have been set.

SQL query

331 byte By Astarot at 2007-9-26 4:58:40
Help me plzResultSet res=con.createStatement().executeQuery("select max(id) from af_org");System.out.println(res.getString(1));It sad "invalid cursor state" or "invalid descriptor index" if I try System.out.println(res.getString(0));Please help me. How can I take max(id)?Thank you. ...

Connection problem with sun.jdbc.odbc.JdbcOdbcDriver

661 byte By javapperrin at 2007-9-26 4:59:24
Hello,I made a Java program which connect to a Ms Access db. It runs ok on my local workstation .I take it to put on a server, layout the ms access driver with the same name and install the jre 1.3.1.So, the program doesn't working on the server, it makes me an error "No suitable driver", ...

Oracle Long dataType = a long text String?

1502 byte By javaVivian at 2007-9-26 4:59:57
Hi all.I'm in the middle of writing a servlet that uses JDBC to connect to an Oracle DB. I need a field in Oracle to store a varchar2 type String without the 4000 characters limiation. I picked Long datatype as it 'stores CHAR data of variable seize up to 2 GB' as said in documentations.The ...

Connection Failed to Sybase DB?

2219 byte By legeriun at 2007-9-26 5:01:05
I am trying to connect to a Sybase DB. My driver loads just fine(JConnect4.2.jar). However the connection fails, even though I know my address, and props are correct....here is the error msg I get: SQLState: JZ00LMessage: JZ00L: Login failed. Examine the SQLWarnings chained to this exception ...

How can I speed up the connection to the database?

651 byte By carrie101 at 2007-9-26 5:01:08
I am running a JSP application with regular JavaBeans not EJB and connecting to the database through these beans. The connection is set to stay in memory as long as the bean is in session. However when I am running more than 7 sql statements seperatly the execution of the page slows down.I have ...

topic - "bye" guy - nothing to do with java

738 byte By jlrober at 2007-9-26 5:02:05
I just want to thank babbela for the kicks I get from his terminating statement of "bye" in all his posts(eg. http://forum.java.sun.com/thread.jsp?forum=54&thread=163436 ) I don't know why it makes me laugh(out loud) whenever I read it, but it does. I think it is funny to me because he/she ...

adding a single quote

1363 byte By pheobeee at 2007-9-26 5:02:30
Hi I am trying to check through a String before it is sent to the database to add in an extra single quote if a single quote is in the String, but it's not workingchar singleQuote = '\'';private static String prepareString (String SQLQuery) {StringBuffer sb = new StringBuffer(); for(int j ...

about local language

218 byte By jafari_fa at 2007-9-26 5:05:31
hello;I want to use farsi language in my product,but I don't know how I can do it?please help me.If my question is wrong please send me right question with its answer.thanks;

registering ODBC driver

261 byte By uri_nadav at 2007-9-26 5:05:50
I would like to access my data source (access file) usingODBC::JDBC driver. I can manually add my data source to the ODBC data sources(it works fine), but I would like to do it in code (java). How do I do it?thanks,Uri.

Problems using updateFloat()

1873 byte By romania1 at 2007-9-26 5:05:54
I'm working my way through the Sun JDBC Tutorial, and have come across a problem in compiling a program containing ResultSet statements. The section of code is as follows; stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);ResultSet uprs = ...

Oracle data source problem

729 byte By pra_sethi at 2007-9-26 5:06:38
Hi Java ppl,I am having problems connecting to an Oracle database and this problem might not be an appropriate one to be discussed in this forum but still.I have Personal Oracle 8.0 and JDK1.3 and I need to connect to the default databse that gets installed on installation of Personal Oracle ...

Connection is busy with results for another hstmt

642 byte By Astarot at 2007-9-26 5:08:15
Hi. Help me plz. I try do two SQL query, one after other, for example ResultSet res=con.createStatement().executeQuery("select * from af_orgatt where org_id="+n+" order by att_id");String att_id=res.getString("att_id");ResultSet res1=con.createStatement().executeQuery("select * from af_att ...

does data type nvarchar in SQL 7.0 have matched DATA TYPE in JAVA

164 byte By liqi1972 at 2007-9-26 5:08:53
does data type nvarchar in SQL 7.0 have matched DATA TYPE in JAVA I use odbc-jdbc bridge to connect to SQL 7.0thanks in advance!

the answer: how to assingn an int type to a Class variable

732 byte By 011576303 at 2007-9-26 5:09:12
Hello Richard and all!I have the answer to the question I asked you, in case this helps anyone else.I was wondering how to user the 'getMethod' method, for a method whose parameter type is an int. in general, the question is how to assing an int type to a Class variable.the answer comes from ...

How to compare 2 CLOBS and 2 BLOBS (oracle 8.1.7)

164 byte By berndgoerz at 2007-9-26 5:10:37
Id like to compare 2 CLOBS and 2 BLOBS in my oracle 8.1.7 db.Does any anyone how to do this?Any help would be appreciated!!!Bernf

Re-using a PreparedStatement in a batch update

1410 byte By DClowe at 2007-9-26 5:11:54
Can I use a PrepatedStatement to add to a batch for a delete and then recreate the same PreparedStatement to do a bunch of inserts and have all the database work be done when executeBatch() is called?Or do I need a seperate PreparedStatement for my deletes and inserts?// Add the delete old ...

How to hold values in resultset.

643 byte By ragunath.m at 2007-9-26 5:12:37
Hi All,I'm trying to get the record from the oracle db in the server side. In the server side i have a servlet, which makes the query and get the resultset. Suppose if the servlet get 50 records from the query, it is supposed to send only the first records to the client. And if the client ...

ORA-01001 Invalid Cursor while calling stored procedure

4105 byte By skuruganti at 2007-9-26 5:13:12
Hi allI am getting an invalid cursor error when I call the stored procedure from the stateless session bean.But when I call the same stored procedure in a simple java program it is executed.I am using J2EE 1.2.1, Oracle 7.3 (PL/SQL 2.3). The stored procedure has a REF CURSOR as a IN/OUT ...

the problem of return value from a method

906 byte By daweiguan at 2007-9-26 5:13:29
Hi everyone:I want return a value from following method. The basic idea is that I want use Num as a parameter to get a value from a field, therefore I can input this value into another database for the display purpose by using other classes. However I got error message when I compiled it. ...

resultset

278 byte By janwars at 2007-9-26 5:14:24
hi,I am thinking that the resultset only persists as long as the connection to the db, is there any way to get around that? or do I need to create my own resulset class without this restriction and dump the data in there. thanks a lot .

Drivers

513 byte By mgroza at 2007-9-26 5:14:27
Hi, I am using type-2 driver with oracle,I have installed oracle8 personal edition in my computer its working well with odbc(Type one).I have set classpath for OrcaleDriver.While using type-2Class.forName("oracle.jdbc.driver.OracleDriver");Connection con=DriverManager.getConnection("jdbc ...

Driver and setting for Oracle

351 byte By lowfundaguy at 2007-9-26 5:14:51
Hi junta,I am new to Java technology. Now I am working in J2ee (forced to .. sort of). So please help me out. I have to use Oracle DB with J2ee. I will soon be getting the Oracle client installed on my m/c. What settings do I have to do (both before and during) deployment. This is ...

Oracle Number Maps to BigDecimal

471 byte By abhishek_srivastava at 2007-9-26 5:15:00
Hello All,when I extract data from a Oracle DB using Oracle driver I find that all the Number fields are populated as BigDecimal (getColumnClassType) in the record set.My question is that should I continue using BigDecimal orshould I use something like Long.what is the normal practice that the ...

problem with scrollable resultset of oracle

603 byte By illfly at 2007-9-26 5:15:14
I encountered problom like this:when I use s=createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);and getString of a resultset,I get the right data.However ,when I uses= createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);and getString of a ...

ms sql server connectivity

138 byte By charanjay at 2007-9-26 5:15:23
how do connect to ms sql server without the help of ODBC. is there any drivers available in the likes of Oracle JDBC Drivers

get the Exception:invalid dynamic status

797 byte By simonyu at 2007-9-26 5:15:37
I have the problem that when I use "Connection.close()" to close the ODBC connection, I get the exception"[Microsoft][ODBC Microsoft Access driver]invalid dynamic status"I have tested several cases,the problem is when I open the ResultSet, then I cannot close the connection. The Following is my ...

Chinese input problem.

1605 byte By fkweric at 2007-9-26 5:15:50
Dear all,i hava a problem for getting chinese data from the database. i am using:jdk1.3.1MS SQL server 2000 eng versionWindow 2000 adv server eng versioni-net OPTA? 2000 JDBC DriverI tried many ways to find out where is the problem come from. First, I write a simple class to print out Chinese ( ...

retrieving a table from an oracle stored procedure

719 byte By mkowales at 2007-9-26 5:17:03
can someone tell me how i retrieve values in a table from the following stored procedure:TYPE tRowID IS TABLE OF NUMBERINDEX BY BINARY_INTEGER;FUNCTION Pa_Search_Notes(in_string IN VARCHAR2,in_search_type IN NUMBER,in_types IN VARCHAR2,out_rowsOUT tRowID)RETURN NUMBER;here is my code (it throws ...

How does ejb container know if a method is called within a transaction?

172 byte By zahran at 2007-9-26 5:17:45
Hello all,How does ejb container know if a method is being called within a transaction?.I appreciate of someone can answer this question.

jdbc type 4 driver/AIX db2 udb & plans & packages

1445 byte By gpaulbn at 2007-9-26 5:18:06
Greetings,I am using Merant's type 4 pure Java driver to connect to an AIX(4.x) box housing a db2 udb(6.1). My connection is successful, however upon requesting data via sql within a callable statement I receive the error: prepareCall() Failed: Message: [MERANT][DB2 JDBC Driver][DB2]PROGRAM ...

database metadata problem

1763 byte By marcalena at 2007-9-26 5:18:57
Hi,I created an application and use data value to retrieve all values from MS SQL.Now my problem is:1)Why can't i retrive values?It shows no value in my DB.The source code is:try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con = bill.getConnection();stmt = con.createStatement();String ...

Easy Question about PreparedStatement

781 byte By stephensutherland at 2007-9-26 5:19:38
Hi Everyone,I have a prepared statement. like this "INSERT INTO Accounts VALUES(" + "SeqAccountId.nextval" + ",?,?,?,?,?,?,?,?)"; dbStatement = dbCon.prepareStatement(sqlStatement); dbStatement.clearParameters(); dbStatement.setInt(1,paymentMethodId); dbStatement.setString(2,accountName); ...