Hi,
I have downloaded binary JDBC Driver from both postgresql.org and
jdbc.postgresql
it's version is jdbc7.1-1.2/jdbc7.1-1.1. It always give a message like this

Exception in thread "main" java.sql.SQLException: ERROR:Ÿ฿Unterminated
quoted string

   Ÿ฿Ÿ฿at org.postgresql.Connection.ExecSQL(Connection.java:533)
   Ÿ฿Ÿ฿at org.postgresql.jdbc2.Statement.execute(Statement.java:294)
   Ÿ฿Ÿ฿at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:59)
   Ÿ฿Ÿ฿at Test.main(Test.java:20)

I have also tride to rebuild the source code with
./configure --prefix=/opt --enable-locale --enable-multibyte=EUC_CN
--with-CXX -with-java -with-openssl=/usr
1)Ÿ฿for JDBC it can complete compilation, but use JDBC with problem
2)Ÿ฿for libpq--> input.c -->on_exit() :

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../../src/interfaces/libpq -I../../../src/include -I/usr/includeŸ฿-
c -o input.o input.c
input.c: In function `initializeInput':
input.c:157: warning: passing arg 1 of `on_exit' from incompatible
pointer type
input.c:157: too few arguments to function `on_exit'

3) my table customer is very simple : cno char(10),cname varchar(50)
my source code :

import java.sql.*;
import java.io.*;

class Test{
   Ÿ฿Ÿ฿public static void main(String args[]) throws Exception {
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿System.out.println("input :");
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿BufferedReader in=new BufferedReader(
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿new InputStreamReader(
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿System.in
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿)
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿);
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿String t1=in.readLine(); //here i can enter some Chinese
string
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿System.out.println("your input are :"+t1);Ÿ฿
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Class.forName("org.postgresql.Driver");
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Connection dbconn=DriverManager.getConnection(
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿"jdbc:postgresql:redauto","postgres","");
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Statement st = dbconn.createStatement();
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿String str_sql="SELECT * FROM customer where cname='"+t1+"'";
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿System.out.println(str_sql);
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿ResultSet rs = st.executeQuery(str_sql);
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿while(rs.next()) {
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿System.out.println(rs.getString(1)+"\t"+rs.getString
(2)+"\n");
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿}
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿rs.close();
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿st.close();
   Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿Ÿ฿dbconn.close();
   Ÿ฿Ÿ฿}
}



I am shade to have disturbed you.
you are kind for me if you can give any sugestion.
Thanks very much.

malix
shanghai china


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html


Reply via email to