I have got Hibernate working just fine when fetching rows based on one primary key, but now I have a situation where I need to fetch a row based on a composite key. At present for a single key, I'm using: -public Priority get(Integer id) {Session session = ...
Hello everybody,I'm trying to figure out why Java returns me this error ion various situation:java.sql.SQLException: [Microsoft][Driver ODBC Microsoft Access]COUNT field incorrect.As you can see I'm trying to use a Prepared stetement with jdbc:odbc(is possible, isn't it?)The problem is that ...
337 byte By
farakha at 2007-11-27 8:00:40
when am creating db table and inserting records my servlet is working well but when I am importing my db data and then inserting record, the following error appears. I am 100% sure there is no duplicate recordjava.sql.SQLException: ORA-00001: unique constraint (dbName.SYS_C005755) violated ...
2058 byte By
Cracua at 2007-11-27 8:00:57
Hello, I'm kinda new to Java.My problem is with the scrollbar from a JScrollPane which contains a JTable. It's SLOW when I have too many rows to display.The problem is related with the way I use getValueAt(row, column)I used two ways until now, for taking data from a .mdb file: - caching it ...
2069 byte By
AlienXa at 2007-11-27 8:01:45
hi,How do I make a connection do mysql database in my local computer. Im all confused with this.first I did was added the JDBC mysql driver to this location C:\Program Files\Java\jdk1.5.0_12\jre\lib\ext\mysql-connector-java-5.0.6-bin.jarthen I added this in the Netbeans IDE =>> in runtime ...
340 byte By
themassa at 2007-11-27 8:03:11
Dear friends I am in critical condition,i need help from u,any body sent the code for following conditionThe html page and we enter the value and is saved in database.it is made in jsp using struts and hibernateplease sent the code and help me.my id is t.ganga.kavya@gmail.comFriendly ...
I'm encountering a sporadic "Connection has already been closed" SQL Exception when trying to do something with a Connection supplied from a Weblogic 8.1 connection pool.I haven't been able to find any place where we are trying to use the connection after close(), or where multiple threads ...
hey all!!!i ve got a problem with connecting postresql on debian with (to) java application. this problem is quite common (i have done my research on the internet) and there is a lot about it on the net but i just don't seem to be able to resolve this.anywayos = debian sargejava ...
Hi,I am using pgSQL as database with JSP.I have given coomets to each column in table.I have retieved the column comment using :"select col_description('table_name'::regclass,column+index)"Now i have stored these column comments in a combo box.Now i want to retrieve the column name matching ...
hi , i am darshanI dont know how to create and drop table using hibernate.please help me out.
455 byte By
jawadaha at 2007-11-27 8:07:41
HII'm having problem with javaDB. it can be run in netbeans but when i run the application when netbeans is not running there is no data shown. My question is how to run javaDB server on Windows.I'm using Access for the time being so when i get data in JTablel date column shows dat like ...
folksi am trying to form a String variable with the below SQL code , Please let me know how to deal with escape characters select col1,col2,col3 from table1 where col5 = param1 and upper(col6) = 'A'and col7= 'TABLE2 NAME'and col8 LIKE UPPER('param2%');param1 and param2 are input ...
Im using Hibernate3. I am trying to add a record of "orderdetail", also setting its many-2-one association "order", which include a many-2-one association with "employer".Mycode is: public class OrderdetailDaoTest {public static void main(String[] args) {// TODO Auto-generated method stubtry{ ...
Seems easy but it appears not to be a "normal" cast.I need a way to convert input strings into sql.date objects to store them in my DB trough PreapredStatement*.setDate().I tried all the ways founded in forum but noone seems to works.Anybody knows a working code ...
Hi all!I am looking for some advice.I plan to generate pdf reports on the following:1.Gender count of total applicant pool = M/F.2. How many are freshmen, sophomore, etc...3. How many applications are complete4. total number of applicants for the year. This will be plotted on an x-y graph for ...
Hi Everyone,I have two methods, one to insert data in DB by calling a stored procedure and other is retreive data using a select stmt. I call insert method and next sequential is select method. In such case I could not retreive the latest data inserted. If I insert a sleep of 1 sec only then I ...
Does Java have a class that is similar to the Microsoft .NET System.DBNull class?
Hi, I have a search text box where i will key in the data like "TigerWoods" where the data in the Database is like "TIGerWooDs". So when i pass the name as a paremeter in the DAO layer and send the parameter in a query to find the name. It is giving me no result since the name entered in the ...
Hi allI am new member to SDN.This is my first post.My request is:I have written a servlet to send data to the database(Access).Now i want to retrive the data from database using servlet and display in my jsp page.I have done the process but iam getting the null value in my jsp page.Can anyone ...
184 byte By
Meenaxia at 2007-11-27 8:16:00
how to do DDL Operation in hibernatelike creating table,creating sequence,droping table,how to get sequence value from table like select next.val from dual;
6622 byte By
bakesa at 2007-11-27 8:16:08
The name of my database is Socrates.The name of the table in the database is EmployeesI want to be able to add data to the database. i am presently working on the add button such that when i enter date into the textfield and press the add button it should automatically register in the table.The ...
Hello every one,i have to write the code that used for diffrent databases like oracle,sql-server2000..the problem has generated at the auto increment field...the problem is as follows....1) Identity field in sql-server but not in oracle because for oracle it uses indexi try like <id ...
Hi All,I am using mysql as a database for my project.Now i want to check wheather mysql server is running or not using java code how to write the code for checking wheather the mysql server is running or not.please help me Thanks in ...
I'm trying to figure out the syntax (java) for retrieving the return value from a SQL statement... so in java I'm calling some sql stored procedure that does:SELECT * FROM SomethingReturn 1How do I get the return value from the SQL Stored Procedure?Thanks in advance for any ...
1010 byte By
Aknibbsa at 2007-11-27 8:19:52
Hi all I was wondering if anyone would be able to come up with some possible ideas as to why my application is inconsistently retrieving data from a database. I have an application that is pulling information from a database. These calls can be made repetitively pulling the same information ...
I have a problem here connecting to mysql database from netbeans.. tried to uninstall and reinstall but still the same problem.. i have the connector file and these are the steps followed:1. Launch netbeans 5.5 and click on Runtime and right-click on Databases.2. Select New Connection and click ...
Not entirely certain whether this is a straightforward Java or more of a JDBC specific question:I have two fields, one is a String and one an integer. I need to concatenate these fields together to form one String, prior to performing an insert on a table. ie:String s = ...
Hi all,I am new to Solaris and i want to create an application using JDBC database connection.I want a small piece of code, probably a login page code that verifies the username from a OpenOffice database (.odb) file. I am particular to know the driver name, etc. If possible give the code using ...
330 byte By
mod_pa at 2007-11-27 8:22:44
Hi,I have to perform multiple updates on a table based on ids. To avoid multiple DB hits, I am using PreparedStatement's Batch. I wanted to know the number of statements that can be added to the batch without performance hit or any other issue. I am talking about 1000, 5000, 10000 or ...
580 byte By
Boomaha at 2007-11-27 8:24:56
Hi there. Really simple question for someone to answer I hope. I have two databases that contain the same tables. I simply want to select a record from one and insert it into another.It is not as simple as selecting it and iterating through the columns using the getString though because some of ...
1181 byte By
dbunita at 2007-11-27 8:25:16
Hi all,I have downloaded Maven and for installation i followed below steps:1. Unzip maven-2.0.7-bin.zip to the directory you wish to install Maven 2.0.7. These instructions assume you chose C:\Program Files\Apache Software Foundation\maven-2.0.72. Add the bin directory to your path, by opening ...
1278 byte By
Sideina at 2007-11-27 8:26:50
I was just curious if there is a more efficient way to assemble a query based off of user input. I have eight fields that are filled out by the user but not all of them have to be filled out. I currently am assembling the query by looking at each field and appending cases to the ends of two ...
I am connection to two SQL servers of which one is SQL authentication and other is SQL authentication.I have currently an application which connects to the SQL Server using SQL authentication The method used to create an application is below:public static Connection GetSQLConnection( String ...
Hi All,because of slow performance, I'm currently considering taking the tables from my database and loading them into memory for faster access. My application is very query intensive and some coworkers have suggested to me to try loading the database tables into memory (using collections) and ...
Hi! I've an application that reads an XML file. This file contains de definitions of some tables, using java sql types. For example:<dbtable> <dbtablename>Name of table</dbtablename> <dbtablefield><name>Name of table ...
180 byte By
AlienXa at 2007-11-27 8:30:25
hi,How do I access a mySQL database through a desktop application in java. its not web based. just have some windows to deal with data. how do I do this.Cheers
180 byte By
AlienXa at 2007-11-27 8:30:28
hi,How do I access a mySQL database through a desktop application in java. its not web based. just have some windows to deal with data. how do I do this.Cheers
hello, can anyone help me by pointing out the basic differences between the relational dbms and the dbms .
My excel sheet data isTest笛椐慌亍闼凌 I am using JDBC connectivity for accessing the Excel sheet.Code looks like,/***************************************************************************/List Output = new List();try{ Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" ); c = ...
How can i call sql server 2005 reporting service from the web browser and/or JSP? How can i pass query parameter for getting appropriate result?Please reply me if anybody has any idea................
Hi All,Well I wasn't able to decide where to post this, since this is a table design issue, but since I would be using JDBC for this hence decided to take your opinions here.I need a suggestion from you all. I have a table designed as Class, Student, Day, Attendance. there could be 50 maximum ...
Hi,I am facing a very weird problem. There is a jar file that is run from the command prompt connecting to SQL Server on the same machine. This program basically does some processing of records within a SQL transaction. Sometimes the program ends with a NullPointerException at a ...
504 byte By
balteoa at 2007-11-27 8:31:49
Hello,I have to deal with a single table which is as follows:amountdebit/creditclient30dA40cA20dB10cB5cB2dAI want to end up with this:debitcreditclient 3240A2015BBasically what I have done is a sum on the amounts of the same kind (d/c) and a group by on the client.I have no idea on what SQL ...
2042 byte By
Uicaa at 2007-11-27 8:31:53
Hi all,here's a problem that I've been trying to solve for several days: I try to select rows from an MS SQL Server via JDBC that contain a certain numeric value at a certain position in a long varchar field.I'm using queries likeselect * from table where substring(field_1, 37, 7) like ...
6278 byte By
kc81a at 2007-11-27 8:32:01
need help urgently,am useing microsoft access as my database,whenever i try to insert data into the table i have in my database it tells me syntax error in INSERT INTO statement.please how do i overcome this problem.my code is below.thanks in advance.'\n'import java.awt.*;import ...
Hi,I'm a technical analyst with a payment processing company, and have been asked to investigate why an application of ours keeps crashing out daily, due to basically too many open connections into an Oracle database. The app gets a lot of traffic, and is hosted in Jrun. Its written in JSP, ...
I am doing encryption and decrpyion of String in single Java file it is running smoothly.But while I am storing the key (It in the byte[] Format) in the DB after encryption i.e. in the String format. by doing it as byte[] variable.toString() method.And while retriving from DB I want that String ...
I have a Java program that I am running and I am connecting to the database.Normally, I have scripts that I run from a command prompt for Oracle such as @create_ddl_wt. I want to run these from my program but I don't know if it is possible to call these scripts. Is there any way possible to ...
I am pretty good at Java programming, and I have experience using MySQL with PHP, but I can't seem to figure out how exactly to work with MySQL in Java. I know I need JDBC, but I don't know where to download it, or how to set it up. It would be great if I could get a walk-through on exactly ...
Hi,Currently I am porting my code to SQL Server 2005 from 2000. I am facing the below problems in one of the screens. Can someone point out what could be the cause. We are trying to fetch column metadata.Also the same piece of code works fine for the 1st time. However, when another form is ...