Hibernate prob - getting a row based on composite key?

1267 byte By RageMatrix36a at 2007-11-27 7:58:49
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 = ...

Prepared Statement & Microsoft ACCESS JDBC:ODBC

1208 byte By Pentolinoa at 2007-11-27 7:59:24
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 ...

java.sql.SQLException: ORA-00001:

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 ...

fast scroll for a table ?!

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 ...

MySQL with NetBeans problem

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 ...

Help- Html page(jsp) and databse (save value) by struts and hibernate

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 ...

ConnectionPool expectations?

1096 byte By gmckinnea at 2007-11-27 8:04:17
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 ...

java + debian + postgresql

2516 byte By velladecina at 2007-11-27 8:05:55
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 ...

How to get column comment

959 byte By Atmaling_Kshirsagara at 2007-11-27 8:06:06
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 ...

creating and droping table using hibernate

114 byte By darshan.karlea at 2007-11-27 8:06:28
hi , i am darshanI dont know how to create and drop table using hibernate.please help me out.

how to run javaDB

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 ...

Escape Characters ?

378 byte By kmathewma at 2007-11-27 8:08:46
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 ...

java.lang.NullPointerException throwed when doing Hibernate Persistence

14428 byte By j2ee_novicea at 2007-11-27 8:09:12
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{ ...

convert String to sql.Date - seems not so easy to me

314 byte By pentolinioa at 2007-11-27 8:10:03
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 ...

Multiple queries to generate reports on mysql data

2058 byte By iketurnaa at 2007-11-27 8:10:05
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 ...

Callable Statement

401 byte By AravindUSAa at 2007-11-27 8:11:12
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 ...

System.DbNull?

88 byte By wildenera at 2007-11-27 8:11:24
Does Java have a class that is similar to the Microsoft .NET System.DBNull class?

Data Comparison from the DB during Search?

854 byte By AnanthJavaa at 2007-11-27 8:14:11
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 ...

retrieving data from database to jsp

390 byte By want2knowabt_javaa at 2007-11-27 8:15:53
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 ...

DDL in hibernate

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;

Add data to the table in the database with the use of add button

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 ...

Auto Increment in hibernate

812 byte By pandev84a at 2007-11-27 8:16:49
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 ...

how to check wheather the mysql server is down or up using java code

311 byte By prakash.nmsp@gmail.coma at 2007-11-27 8:17:38
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 ...

Get SQL Return Value

317 byte By crimminsda at 2007-11-27 8:18:48
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 ...

Inconsistent results from database calls

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 ...

Illegal connection port value for mysql/netbeans

757 byte By nastassjaa at 2007-11-27 8:20:10
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 ...

'Join' two different field types together into a String - possible in Java?

1456 byte By speedyvespaa at 2007-11-27 8:20:17
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 = ...

how to use JDBC database connection in Solaris

377 byte By Parasou79a at 2007-11-27 8:22:12
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 ...

Batch Limit

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 ...

Copy record from one database to another

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 ...

DbUnit Problem

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 ...

Query assembly efficiency

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 ...

SQL Server Authentication

2935 byte By SirAnanda at 2007-11-27 8:28:09
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 ...

Virtual Database? Load Tables into Memory

2828 byte By mikeyfreakea at 2007-11-27 8:28:21
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 ...

Create table dinamically using java sql types?

1656 byte By obirenokenobia at 2007-11-27 8:29:31
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 ...

access mysql through java desktop application

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

access mysql through java desktop application

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

difference between dbms and rdbms

120 byte By Sreeram_MPa at 2007-11-27 8:30:45
hello, can anyone help me by pointing out the basic differences between the relational dbms and the dbms .

Non-English string access from excel sheet through JDBC

1506 byte By swapan007a at 2007-11-27 8:30:47
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 = ...

call Sql Server 2005 Report from JSP

220 byte By IstiyakVasiwalaa at 2007-11-27 8:30:48
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................

Performance while fetching data from large record set

1540 byte By jayantkdasa at 2007-11-27 8:30:56
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 ...

NullPointerException on execution/ creation of a PreparedStatement

1033 byte By Jyothi_naira at 2007-11-27 8:31:22
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 ...

SQL beginner need help

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 ...

Searching for numeric values in a text field / SQL Server

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 ...

insert statement problem

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 ...

Strange JDBC errors? Possible session management issues - any pointers?

2105 byte By scottinchama at 2007-11-27 8:32:18
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, ...

About Encryption and Decryption of String

586 byte By koustubha at 2007-11-27 8:32:34
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 ...

Running sql scripts.....HELP

365 byte By gabel3469a at 2007-11-27 8:33:47
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 ...

Need help getting everything set up :\

371 byte By nullbyte00a at 2007-11-27 8:33:52
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 ...

SQLServerException: The operation requires a single user connection.

1220 byte By MysteriousMana at 2007-11-27 8:34:02
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 ...