I am new to sql and I was wondering how i can add a list to a database. Here is what I mean:
I have an a java class like this ... |
Our mysql server has "SQL_NO_CACHE" off by default, and I wish it off for my application. I can rewrite all my SQL statements but it sound stupid.
According to the |
When using PreparedStatement's setObject method for a column of type TEXT (in a MySQL DB), what should the last parameter be?
For example, I know that this is ok for a VARCHAR ... |
So far, I have not found a clear answer to this.
I'd like to know what the equivalent is for a SQL type DATETIME and the java type, using a PreparedStatement.
I ... |
I am trying to unit test a thin data access layer that I've written. I was hoping I wouldn't have to inject a stub of DriverManager into the class that makes ... |
Simple question. I am using Java and MySQL database. I want to write database access methods what would use PreparedStatement method and would be parametrized, such as:
public DBResult selectQueryWithParameters(String SQL, ...
|
I have a mysql db with several tables, let's call them Table1, Table2, etc. I have to make several calls to each of these tables
Which is most efficient,
a) Collecting ... |
|
I have a table that has 3 fields, ID, Name, Address. (Name and Address are type String)
There are instances, where the Address is left Null. How do i write an SQL ... |
I have a question regarding how to use an object oriented approach while using an RDBMS such as mysql. I am developing a small application that will keep track of billing. ... |
I keep getting the error "The method isValid(int) is undefined for the type Connection"
I am currently using eclipse galileo, have JRE and JDK 6, and have all appropriate .jar files available.
i ... |
I am getting the following error while running a batch job.
sql.SQLException: Prepared statement needs to be re-prepared
In what cases is this error encountered ?
|
I'm kinda stuck in a tricky situation with the mySQL DB design for my webservice.The DB had initially this Structure:
CREATE TABLE IF NOT EXISTS `Disease` (
...
|
I'm working on a SOAP based webservice where in a part of it i have to perform some queries on the database using nested loop, the problem is that the inner ... |
I am trying to add Sonar to my Continuous Integration build system. I am using ANT as my build script and I am using the sonar-ant-task-1.1.jar for sonar to generate the ... |
I have java code which connect to MySQL and retrive data. I have following code and it always give SQLSyntaxErrorException and says there is syntax error in line 1. I cant ... |
I'm trying upload image to database using Java.
I've used following code to do that work.
File file= new File("image.jpg");
FileInputStream fis = new FileInputStream("image.jpg");
String query = "insert into mytable(id,image) values(?, ?)";
PreparedStatement stmt ...
|
Hi i have written a java code to create xml tags in separate xml file(.xml) and query the database. my xml tag is in this format
<company comp:loc=" "/>
now i ... |
In my Java app, I want to query the MySQL status statistics. I'm adding some simple monitoring (mostly writing alerts when certain settings reach certain thresholds).
In any case, I can't ... |
I have a huge SQL file that I want to restore to mysql server 5.5 .... while I'm restoring the the file at the middle of restoring process stopped, then i ... |
I want to save time intervals in my SQL table but I'm not sure what type to use in Java for this.
What I need to store are durations like 12:33:57 or ... |
I would like where am I supposed to install MySQL JDBC driver in Eclipse so it can be detected and used by SQL Explorer.
Just to be clear, if possible, I would ... |
is it possible to create a connection from a MySQL DB to a remote database (probably Oracle) using something like an ODBC/JDBC connector? I need to create a trigger on the ... |
I am trying to add entity classes that are from a database. I successfully created the connection resource using glass fish server and tested.
But when i try to add the ... |
I'm using com.mysql.jdbc.Driver (If it means anything).
I want to be able to catch and properly process the exceptions I receive from MySQL. I want to know if the transaction failed, if ... |
I am using JDBC.My test application inserts some data into MySQL,then query it via the same connection.I have four computers,one is MySQL server,three are UBuntu Desktops.In one UBuntu Desktop,my test application ... |
I am trying to figure out the best way to get MySQL to use batch updates.
I create, let's say, 10,000 records. Each record needs to be inserted into the DB like ... |
High, I'm trying to create a mysql instance inside my code by utilizing mysl-je.jar for both windows and Linux. When I try to register the embedded driver, I recwive a sql ... |
I'm coding on Jitsi using Eclipse: I have to use JDBC to connect to MySQL database, so I've imported java.sql.* in my MainFrame class and I've included mysql-connector-java-5.1.18.jar into "Java Build ... |
I have a mysql db with a column with a datetime field.
However, I cannot find a way in java to return this as some sort of time object within java, ... |
I have used jdbc to delete records from the table, while eexcuting the same, I got an error as I have shown below :
java.sql.SQLException: Before start of result set
...
|
I wanted to try using SQL with Java, so I downloaded mysql-connector-java-5.1.18-bin.jar.
I'm using Eclipse, so I went into Eclipse, Project -> Properties and added the jar files.
I also added the following ... |
I have had quite some difficulty trying to make a User Defined Function (UDF) in Java for my MySQL Server. I was hoping I could ask for some help on this ... |
I have downloaded the connector/jar file and moved it to the lib\ext folder. But when I run the ready-made code to test if the java file is connected to the database, ... |
I have a java.sql.CallableStatement with 3 parameters, and I need to call it many times, passing different values for the third parameters.
What is the right way to do this? ... |
I'm running a Tomcat WAR, which uses a MySQL database.
The application will run in foreign languages, so I had to change all database character parameters to utf8.
One application string (appPrefix) has ... |
With this code
String url = "jdbc:mysql://localhost/mysql";
Connection con = DriverManager.getConnection(url, "root", "");
I get the following exception.
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
...
|
I need to make a project in java where I am going to create a database, but my problem is, I don't know what to pick, I have knowledge about SQL(Select ... |
This post has NOT been accepted by the mailing list yet. Hi All, I want to test the database which is installed in a different server ( say dimvidi2202). But while I am running the test it gives the error as java.sql.SQLException: No suitable driver found for jdbc:mysql:. Any idea pls???? Is anywhere I am doing anything wrong... I did ... |
|
I've had the same problem. Can I guess that you're not running *nux and are in Windows instead? If you search the MySQL docs, the password function is supported by the crypt() system call. This doesn't exist in Windows. I had a search and I think there are implementations you can plug in, but I never bothered... Is this the problem ... |
|
When I set up my environment at my hosting company a few years back, I chose PostgreSQL over MySQL since, at least at the time, MySQL did not have transaction support. That may have changed since; I haven't really kept up since Postgres satisfies my DB needs completely. Another thing I really like about Postgres is its support of the LIMIT ... |
|
Hi Greg, it's actually more SQL than MySQL. It has a slight bias to MySQL, but is fairly generic SQL code which, with few exceptions, will play nicely with Oracle. The most important focus for me with this book was to get the concepts out there. It's easy to look up syntax when it occasionally varies, but to understand how and ... |
|
You will have to find a tutorial about dumps in MySQL; there is something in "Beginning MySQL" by Sheldon and Moes (Wrox) which is a very nice book and not too expensive, but was printed in 2005 and could do with a new edition. "DDL" is usually taken to mean Data Definition Language and means things like "CREATE TABLE", as opposed ... |
This simple sql statement works at the command line but not when executed through a PreparedStatement. I have looked at several examples on the web but have not found the error. Can anyone suggest something to try? mysql> select userName, password, userType from registered_users; +------------+----------+---------------+ | userName | password | userType | +------------+----------+---------------+ | tuser | tpwd | Student | | ... |
|
Can someone spot my error? I cannot seem to figure it out. Could be my jdbc driver, I'm currently using 5.1.14 jdbc driver. public int update(String sku, String category, String description, String name, String price, String inventoryLevel, String brand, String gender, String size ) { int i; con = dbcon.SimpleConnection(); PreparedStatement ps = null; ResultSet rs; int prodId; try { System.out.println("Indise ... |
|
Hi All, I have installed ubuntu 9 and downloaded mysql-server, JDBC connector and Eclipse 3.2 via synaptic Manager. The versions I have mysql-server 5.1 (5.1.31 ubuntu 2) mysqlclient 5.1 (5.1.31 ubuntu 2) libmysql-java 5.1.6 JDBC (mysql-connector-java-5.1.6-bin.jar) ubuntu 9 I was testing a simple code to check if a connection with a test database is established or not on mysql server but ... |
hi, this is ayesha parween. Basically we manually connect to the mysql server and go to the administrator and take the back up of the file and load the sql script for creating a schema creating the tables and populating the tables with the data. Is it possible through some java jdbc for connecting to the mysql server and creating the ... |
Mahendralal, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem. Also, this is a forum, not a code factory. Recommended reading: [http://catb.org/~esr/faqs/smart-questions.html] I'm locking this thread now. db |
Hi i am facing the problem of running a java program that queries an SQL database. It works perfect when i am running it with netbeans but has a problem in running through the command prompt this error message comes up java.sql.SQLException:No suitable driver found for jdbc:mysql://127.0.0.1:3306 can someone pls help me to fix it |