jsp « JDBC « JSP-Servlet Q&A





1. Strange problem with JDBC, select returns null    stackoverflow.com

I am trying to use JDBC and my query is working in some cases but not working in others. I would really appreciate any help. Some of my code:

public Result getSpecificTopic()
   ...

2. problem generating random no in java    stackoverflow.com

i have written a code like this but it is giving exceptions.actually i want to generate a random value.save into the database and return the same to the user

import java.math.BigInteger;
import java.security.SecureRandom;

public ...

3. jsp coding problem    stackoverflow.com

I am a programmer, new to jsp, trying to write some code. i have written like

    <%
            ...

4. jsp programming    stackoverflow.com

I want to retieve username from database, but it gives empty page. What is wrong in my code?

<html>
<head>
<title>verification</title>
</head>
<body>     
       <%@ page ...

5. result set jsp - how to use?    stackoverflow.com

Can someone please tell me why this isn't working? I would like to be able to check if the username/password returned from the DB query is equal to a value. Session ...

6. How to use JDBC in JSP?    bytes.com

Friends, I want to connect to mysql database using jsp. But I am not getting how to do it? Because it throwing exception at the line Class.forName("com.mysql.jdbc.Driver"); Please help me. Can ...

7. Confused...about JDBC,    coderanch.com

hi, I have been trying to get this JDBC running with Mysql database, my systems spec is as follows: platform : Win98 Tomcat version 3.3 Mysql version mysql-3.23.38 JDBC Driver: mm.mysql-2.0.4-bin JDK 1.3 Now i got tomcat running, and also the jsp examples running, mysql is also running fine on its own and i created a simple database with one table. ...

8. Using JDBC how to put single quotes(')    coderanch.com

I am having this problem with JDBC ... Using INSERT INTO statement i want to insert a row in my database and the variables that contain data might contain a single quote (') within them ... whenever i use a single quote in any of the text feilds that are to be inserted in the database i get an error i.e ...

9. jdbc dirver    coderanch.com





10. JSP and JDBC    coderanch.com

11. jsp and jdbc    coderanch.com

In short there are many ways of executing SQL queries against the DB from the JSPs however in short there should be NO direct link between the database layer and the presentation tier. Separate your application out into 3 distinct layers Presentation, Control/Business, and Persistence ( more commonly known as Model View Controller orMVC). Only put code that accesses the database ...

12. jsp and jdbc    coderanch.com

13. JSP & JDBC implementation question    coderanch.com

Hello All, Currently I'm using JSP scriptlets to establish connectivity with a database (with all variables declared within a JSP page). This database will be accessed from a number of pages. I'm thinking about using a bean (with application scope) to establish a connection and store all necessary variables. This way, I can use the bean (and the database connection) by ...

14. JSP & JDBC    coderanch.com

15. JSP and JDBC    coderanch.com

16. JSP / JDBC - beginners question    coderanch.com





17. jsp and jdbc    coderanch.com

18. code for JSP JDBC    coderanch.com

19. JSP/JDBC problem    coderanch.com

20. JDBC and JSP    coderanch.com

As vikassheel gupta show in the last post it is very easy to create the connection in a class and return results. As far as displaying it in the JSP the possibilities are almost limitless. What you really have to figure out is do you want the data in a simple

format or do you wish to display it in ...

22. interclient type 4 JDBC installation    coderanch.com

23. JDBC    coderanch.com

24. jdbc    coderanch.com

25. JDBC and JSP    coderanch.com

26. Difference between JDBC in 'normal' Java and JSP?    coderanch.com

Hi, I'm going mad. the following code in 'main' works just fine and returns the wantend 4 rows. public static void main(java.lang.String[] args) { String product = ""; int aantal = 0; double price = 0; String id = "3"; double GrandTotal =0; String dbuser = "user"; String dbpassword = "password"; String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; String url = "jdbc dbc:getsildb"; try{ ...

27. JDBC JSP problem    coderanch.com

28. JDBC & JSP    coderanch.com

I want to Know how to insert multiple records at a time in a table from the jsp page. to make it i clear, I explain what i am doing. At first i have a html page which consists of a table and multiple rows. I will be giving inputs in multiple records. After submitting this page, It will open the ...

29. jsp--class.forName()    coderanch.com

I am using Class cls= Class.forName("..."); in my jsp file. but when i run it gives compilation failed and unable to load the class file. Where should i load the class file. I have tried by keeping the class file in the same directory as the jsp file and also by keeping the class file in the directory where the jsp ...

30. JSP for Airline Agency!    coderanch.com

31. JSP and JDBC    coderanch.com

Hi, I have a jsp page in which i am fetching some data from the database and showing it on the screen. The page gets reloaded every 5 mins. I am using stmt.executeQuery() to fetch the datas. So, every time the page is reloaded, the query has to be executed in the backend. Is there any way to cache a Statement ...

32. returning a result set to a jsp    coderanch.com

34. JSP    coderanch.com

35. Getting different results in JSP    coderanch.com

36. group by records in jsp    coderanch.com

I am populating beans using rows in the database.I put these bean objects in a Vector and pass this vector to jsp.I would like to do a group by on one of the bean property example Product Filename1 Size FIlename2 Size2 Filename3 Size3 Product2 Filename4 Size5 Filename5 Size6 Howdo I acheive this??

37. JSP Problem    coderanch.com

Hi All, I'm having a bit of trouble writing code. i want to display the records from the database table which looks like this name month sal month sal month sal sk 5 20000 6 20000 7 20000 abc 5 787 6 666 7 76666. the records are stored in the database are vertical..i want the o/p like above.i m using ...

38. jsp + jdbc    coderanch.com

39. Two result set in JSP    coderanch.com

Hello all I am struggling to get two result set working in one JSP. I am using Apache Tomcat and SQL Server as db server. I have declared them with different variable however when i load the JPS, it comes us with runtime error. "busy with another query or resultset" could you please give me some advise or an example code ...

40. JSP with Visual Foxpro Project    coderanch.com

42. JSP - Unsupported Operation Exception    coderanch.com

hi I tried to write a code that reads the data from excel sheet and writes into DB2 database.It worked perfectly .But if it has repetition fields, then also it inserts the data.So I used a primary key in the database to avoid repetition.Then I wrote a code which inserts data into database when there is no repetition of data.But if ...

43. polling in jsp    coderanch.com

44. jsp errror found    coderanch.com

45. JDBC & JSP    coderanch.com

46. JDBC - JSP help required.    coderanch.com

47. JSP-JDBC    coderanch.com

Dear gurus, I have one requirement. I am in the process of creating one search application for matrimonial and wherein i am getting around 5 to 7 parameters from the users.Now,i should create an Dyanamic SQL statement based on the parameters given by the users.There is a possiblity that the user may enter all 7 parameters or less also. Presently i ...

48. JDBC JSP    coderanch.com

49. jdbc-jsp    coderanch.com

I want to connect my jsp prog with ms sql server. If i want to pass the values which will be taken from jsp file & i want to put it in table,So what will be the command for that? I want to pass the query as variable not the permanent values. Plz help me out.... kshitija

50. JSP and JDBC    coderanch.com

Sky gave a good example of a JSP/JDBC page. If you wanted to build upon it, you could make a JavaBean that handles the connection to the database as well as also returning data in an easy to manage way. Connection Pooling is also a concept to look into which would be more efficient at making database connections and less resource ...

51. Free JSP support Along with JDBC    coderanch.com

52. JSP/JDBC problem...please help!!!!    coderanch.com

53. JSP nad JDBC    coderanch.com

Originally posted by neha sood: Hi ,I am going to start with my first project (this is my very first project using any language) using JavaServlets and JDBC . Please just help me sorting things .like how to start with it and what shud be necessary or good options that must be present in that project ..

54. Aggregate functions problem in jsp    coderanch.com

Computation <% String n=request.getParameter("Index_name"); String m="Update"; String o="SET mcap=dayc*shares"; String d="Select SUM(mcap) from"; %> <% try{ Connection connection = DriverManager.getConnection( "jdbc:odbc:BE"); Statement statement = connection.createStatement() ; String string=m+' '+n+' '+o; int i=statement.executeUpdate(string); Statement stat= connection.createStatement() ; String string1=d+' '+n; Resultset rs=stat.executeQuery(string1); } catch(Exception e){ out.println(" Error occured : "+e.getMessage()); } %> This is ...

55. JSP Problem    coderanch.com

56. retrive table name in jsp    coderanch.com

57. JDBC in JSP not working    coderanch.com

59. How to do group by in a jsp    coderanch.com

Hello All, I am having difficulties while doing the grouping in a jsp. I am having a table which is retrieving the employee No., Directorate. The directorate name is coming duplicate as it is retrieved from the DB. My jsp is displaying: 111 IT 222 IT 333 IT So, I want it in the jsp as: IT 111 222 333 Can ...

60. JTA and JDBC code    coderanch.com

I am bit confused when we connect to databse from java application.I have always worked on JDBC. I have questiions about JTA and ORM like hibernate. 1) Does they also use JDBC internally or they have separate mechanism altogether? 2) I have seen some JTA api code but everywhere on different sites it does not say how do we get connection ...

61. java jsp    coderanch.com

62. using JSP and JDBC for securing    dbforums.com

63. Java / JSP / JDBC - Member Information..?    forums.oracle.com

65. JApplet JDBC Bridge on jsp?    forums.oracle.com