Java is an object-oriented language and runtime environment. Java programs can run unchanged on most platforms in a Virtual Machine called the JVM.

learn more… | top users | synonyms

1
vote
1answer
10 views

JDBC prepared statement - make a token null

So, I have an insert statement in a Java program I'm writing. Under some conditions, I want it to insert some values as null. However, before I can execute the statement, I have to set all of the ...
0
votes
1answer
39 views

Tracking the update or changes in mysql table

I need to stream the changes to elasticsearch to keep in sync with my database(mysql). What will be best way to do this ? I have thought for below approaches Using trigger( but my table will have ...
1
vote
1answer
79 views

Syntax error using preparedstatements with postgresql

I have a Java application connecting to a PostgreSQL database. Using straightforward code like: ps = con.prepareStatement(sql); if (dataTypes != null && dataTypes.size() ...
1
vote
2answers
33 views

Causing ORA errors in a program using JDBC. How can I find what's causing them?

So I'm building a java app to interface with the company's database. Whenever it causes an ORA error, it just prints something like the following to system output: ORA-00911: invalid character Is ...
0
votes
2answers
59 views

Query syntax is checked at java level or Database Level?

If i used normal JDBC Connection for accessing database of Mysql, The syntax of query is checked at java level or Mysql level. Example String Query="Select * fromEMP" above wrong query syntax throw ...
0
votes
0answers
21 views

What are the type of drivers for Communication with Java?

I am developing one application using core java and Mysql Database. As i read in Most of the site, they suggest that use type 4 driver for communication using JDBC. In JDBC Connection i have use ...
-1
votes
1answer
51 views

MongoDB denying API access, while console shell works

I am a MongoDB newbie, with a MongoDB instance running on a Ubuntu machine. If I login onto the machine's console and run mongo -u username -p password databasename I have permissions for the ...
0
votes
2answers
82 views

Install JVM for Oracle 11g XE

I am trying to configure JavaMail in my Oracle 11g XE(11.2.0.2.0) database, which requires loadjava utility. But after some research I came to know that XE version of Oracle doesn't provide Java/JVM ...
0
votes
0answers
68 views

Out of memory error from Java stored procedure

I have a Java stored procedure inside Oracle 11g database. The procedure uses lots of memory, so I'm setting the max memory size in same session: create or replace function setMaxMemorySize(num ...
1
vote
1answer
65 views

SQL Server 2012 CPU usage spikes to 100%

I am using SQL Server 2014 in AWS and the AWS image configuration is 4 cores and 16GB RAM(m3.xlarge). I am running the following simple query, SELECT * FROM user_table WHERE user_id = '10' ...
0
votes
2answers
88 views

No suitable driver found Orientdb jdbc driver

I have some problems with Orientdb driver for jdbc. i´m using Netbeans, i have include the library JDBC+OrientDB libraries (orientdb-jdbc-2.0.8-all.jar) in the directory and in netbeans, i have also ...
0
votes
1answer
38 views

In MySQL why is the first batch executed through client-side prepared statement slower?

I have around a million lines to be inserted into a MySQL (InnoDB) database, so to speed things up I turned to batch/multi-line insert. To be specific, I connect to the database (I'm using Java, so ...
0
votes
0answers
37 views

New Table vs Java Beans to allow user to dynamically change data representation?

I am building a database to store the assessment records of students, along with other relevant information and functionality like reporting on average scores etc. Currently my company uses Excel for ...
0
votes
0answers
45 views

HSQLDB like datasource to JAVAEE APP on JBOSS 7 FAIL

I am having problems while starting a sample app on JBoss server 7.0. Below follow piece of start log: 12:19:10,156 ERROR [org.jboss.as] (MSC service thread 1-7) JBoss AS 7.0.0.Final "Lightning" ...
0
votes
1answer
190 views

Can mutli-threading java client cause high CPU utilization of SQL Server 2008?

I am a Java Developer, not a DBA, and would like to consult about an issue encountered in high CPU utilization in the SQL Server 2008 (not in the Java app server). The Java client uses ...
2
votes
2answers
225 views

Database-agnostic stored procedure call passing array of name/value pairs

Background Looking to pass a set of name/value pairs into a stored procedure in a database-agnostic way, using JDBC. A database structure is defined as follows: CREATE TYPE array_parameters AS ( ...
0
votes
0answers
78 views

Saving String as unique number in Mongo

I have a field in my collection which is a String in nature. When i run aggregation for this field in data it takes considerable time in aggregation. Total 6 million records are in collection which ...
0
votes
1answer
440 views

Can't find sun.jdbc.odbc package in Java version 8 [closed]

I am trying to connect a database query to my class while I compile the package name sun.jdbc.odbc package but it is not found in Java version 8.
0
votes
0answers
73 views

Database design of role permission on resource

I have this database design to manage resources, roles and permissions. role_permission.permission contains an integer as combination of many privileges. The value are power of 2. For example: 2 ...
2
votes
1answer
257 views

Sorting Table and get Position of row

I have a Table with 3 rows. Player, Time, Server. Now, I want 2 things and I don't know how. For Server there are 3 worths available. 1, 2 and 3. Server and Player are a Primary Key together. User ...
1
vote
4answers
137 views

Pros and cons of a particular DB design approach for single vs multiple tables

I just got a new project (in JAVA) where I am thinking of all the pros and cons of a particular DB design approach. Some pointers: Our app has many "content" entities like News, Blogs, CMS pages, ...
0
votes
0answers
57 views

Points/Scores display from and to the Database in Android app

I am an absolute beginner to the Android programming and I am trying to develop an Android application using Eclipse where user is able to login/register and is able to see his "white" points based on ...
1
vote
2answers
577 views

Add function parameter to SQL query WHERE clause

I have a web application in java and it uses a query. I don't want to write the query into Java, so I made a function: CREATE OR REPLACE FUNCTION testFunc(inputs text) RETURNS TABLE(...) AS $$ ...
0
votes
0answers
30 views

MySQL what is the order of the table lock for this query?

An example query looks like this: INSERT INTO Adventure (sword, fighter, quest) SELECT Swords.id, Fighters.id, Quests.id FROM swords Swords, fighters Fighters, quests Quests WHERE Swords._id = ...
2
votes
1answer
57 views

at least one member of a list within another list when querying over a join

assume the current layout in a Mysql datbase Activity (id,etc) [id is primary key] AcitivityMapper (activityID, targetYearID) [composite key] Years (targetYearID, targetYearName) [id primary key, ...
1
vote
2answers
190 views

Are there any special characters that are never allowed in SQL?

I am a Java programmer. We always make database-related things configurable so that they can be easily modified by the DB team as per their requirements. I want to make some queries as configurable, ...
0
votes
0answers
32 views

User or Role is Missing

I'm using a stored procedure in oracle 11g r2 but when I call it from java it says that I'm missing the user or role name when it executes this sql sentence: no_dml := 'CREATE USER ' || no_carne || ' ...
0
votes
0answers
14 views

Can't execute a MySQL stored procedure from Java [duplicate]

I am using MySQL. I gave below permission to Java to execute stored procedures: CREATE USER rateervice@'%' IDENTIFIED BY 'rate$123'; GRANT EXECUTE ON Ratetest.* TO 'rateervice'@'%'; But here Java ...
0
votes
0answers
23 views

Assigning Parent Node Value using IDs

I am using iReport to build a report and I am trying to find the parent node "group_name" value based on a parent_id given, and return the value the parent, as the child's value. For example: Table: ...
0
votes
0answers
92 views

How can I trace Oracle database transaction

I'm developping a JavaEE app deployed on IBM WebSphere 7. We are facing performance issues, especially a high amount of transaction commits. We are using JPA with Hibernate as a provider. Does ...
0
votes
2answers
518 views

Split a string in different columns on basis of no of spaces

i want to split a string in different columns in the following manner through oracle Input String: hello how are you doing Output: hello how, how are, are you, you doing please help guys.. !! ...
0
votes
0answers
96 views

store code/script value as text in database

I have the following situation: I have to work with software, developed in Java, that allows the user to input some custom scripts in order to do some calculations. so i have to store/save the ...
0
votes
2answers
308 views

How to implement a dynamic string into a (prepared) sql statement?

I have some spatial datasets which are available in a open source metadata catalog software GeoNetwork and in a PostGIS database. The problem is that the student who created the database used ...
0
votes
1answer
472 views

Can't restore from mysql dump file

I used mysqldump command to export/dump .sql file with rows like: String cmd1 = mysqldump + " -h" + host + " -u" + username + " -p" + password + " " + "--compact --no-create-info " + "--where=ID=" + ...
0
votes
2answers
205 views

Getting a Deadlock,

I have this code : public void saveItems(List<Pair<Item, MapleInventoryType>> items, int id) throws SQLException { PreparedStatement ps = null; PreparedStatement pse = null; ...
4
votes
1answer
3k views

duplicate key violates unique constraint when using multi-threading

I am using ExecutorService with a fixed thread pool of 50, and a fixed database connection pool of 50, using HikariCP. Each worker thread processes a packet (a "report"), checks if it is valid (where ...
0
votes
0answers
119 views

MySQL insert Needed data only then send it to crystal report

I'm Working on a big project more than 200 table, I'm using MySQL(Percona), Java & Crystal Report JRC. I have some reports which so big & has a lot of joins between multiple tables. Inside the ...
0
votes
1answer
114 views

Java-Hibernate-Oracle: Can a fluctuating DB connection duplicate insert statement?

  Is it possible that a fluctuating DB connection causes insert statement to execute multiple times? Thanks
1
vote
1answer
576 views

How does Sybase store datatime information?

We have a Sybase database that currently stores datetime values in some of the tables. If we move that server with the Sybase database to another country which is in another time zone, will the ...
0
votes
1answer
275 views

Transfer all read request to Slave in Master-Slave MySQL

I have configured master slave on my system (MYSQL). Now, is there is any script or way available or possible to transfer all read request to SLAVE. So, let me make my question here more clear. I ...
0
votes
1answer
72 views

Transforming Huge Database table to Another Table

We are migrating lot of data from our old database to new database. Presently, both of them are actively[writing/reading] used based on flows/activity as migration is in progress. Here's the real ...
0
votes
1answer
33 views

Oracle structural synchronization [duplicate]

I'm having two oracle databases. A is used for production, B is some kind of staging instance where people are preparing content that is brought to the production system over night. It is a fully ...
0
votes
1answer
99 views

Testing multiple queries from input file

I have set of tables and need to execute select query based on different users. Table names are stored in file and I am looking forward to write a script to execute a script to read table name from ...
1
vote
1answer
10k views

Oracle XE 11g (ORA-12514: TNS:listener does not currently know of service requested in connect descriptor )

I have already seen the questioned in the stack overflow that might relate to my problem but let me emphasize that none of them could resolve my issue. issue is: when I wanted to integrate OWASP ...
0
votes
3answers
465 views

Mongo takes too much memory when insert data

I'm using mongo as a database log. I store on it all the logs of an application, so I have a high rate of inserts, for example 100 inserts per second. To accomplish that I developed a part of the ...
2
votes
1answer
143 views

What are possible causes for consistently volatile INSERT performance in MySQL tables?

I have a Java program running on a VM that is sequentially feeding a queue of single row INSERTs through a single connection to a MySQL server on the same VM. The queue execution is not artificially ...
2
votes
1answer
660 views

SpringData MongoDB - infinite getmore on mongo logs

Doing 2 queries on MongoDB through Spring Data on around 160 000 rows, query 1 is executed in few seconds (about 20 results) but query 2 never finish. I'm getting this line over and over on mongodb ...
0
votes
0answers
171 views

Where can I download jvm files for oracle on ubuntu

I want to install Java packages for oracle, and I found following files in the internet. @?/javavm/install/initjvm.sql; @?/xdk/admin/initxml.sql; @?/xdk/admin/xmlja.sql; @?/rdbms/admin/catjava.sql; ...
0
votes
1answer
71 views

monitoring sql execution perfomance of an application that makes use of SP_prepare

we have an application that makes heavy use of sp_prepare and sp_execute and we would like to start monitoring the execution plans of the sql. but this is made difficult by the use of sp_prepare ...
4
votes
0answers
368 views

Postgresql JDBC Table Valued Parameters [closed]

MSSQL has a great feature called Table Valued Parameters. It allows you to pass a table of a custom data to stored procedures and functions. I was wondering what is the equivalent in PostgreSQL, if ...