Under FreeBSD I something haven't dared to be engaged in it, well тат like as replacement to Windows and was necessary to do. The problem is that: there is a program on java which through ODBC communicates with MSAccess base, here this perversion it was necessary to force to work under ubuntu. Have been to begin with established unixodbc and mdbtools. The field of their installation of any labels in the menu hasn't appeared, commands аля unixodbc mdbtools not прокатили, through search надыбыл/usr/share/menu/unixodbc-bin and that there already ODBCConfig, it is necessary to tell to sense from this гуишной covers not much, and hasn't understood as normally what there to make, all errors gave out, by practical consideration and Google has been found out that all that is necessary is in /etc/odbc.ini and /etc/odbcinst.ini. In odbcinst.ini there were driver MSAccess options which to me всётаки it was possible to push. And in odbc.ini options System DNS where actually also should is описалово конекта to base, anything difficult there wasn'tПод FreeBSD я что-то не решился этим заниматься, ну тат вроде как замена винде и делать пришлось. Задача такова: есть прога на java, которая через ODBC общается с MSAccess базой, вот это извращение нужно было заставить работать под ubuntu. Для начала были установлены unixodbc и mdbtools. Поле их установки никаких ярлыков в меню не появилось, команды аля unixodbc mdbtools не прокатили, через поиск надыбыл /usr/share/menu/unixodbc-bin а то туда уже ODBCConfig, надо сказать толку от этой гуишной оболочки не много, так и не разобрался как нормально что там сделать, всё ошибки выдавал, опытным путём и гуглом было выяснено, что все что надо находится в /etc/odbc.ini и /etc/odbcinst.ini. В odbcinst.ini находились настройки драйвера MSAccess которые мне всётаки удалось запихнуть. а в odbc.ini настройки System DNS где собственно и должно находится описалово конекта к базе, ничего сложного там не было
11 22 33 44 55 66 77 88
| [myConnection][myConnection] Description = Microsoft AccessTS Description = Microsoft AccessTS Driver = MDB1 Driver = MDB1 Database = /home/vampirus/db1.mdb Database = /home/vampirus/db1.mdb Servername = localhost Servername = localhost UserName = UserName = Password = Password = Port = 5432 Port = 5432 |
помойму only Driver, Database here are necessary but time works and so that has left)помойму только Driver,Database тут нужны но раз работает и так то оставил)
Has checked up work проверил работу
11 22
| isql-v myConnectionisql -v myConnection select * from Realtion select * from Realtion |
Works, well I think hurt, so it is simple, I will check up in the evening, how there java with it will make friends, and has gone for work.работает, ну думаю зашибись, так просто, вечером проверю, как там java с этим подружится, и пошёл на работу.
In the evening. Вечером.
About attempt of start the program dropped out with an exception, still after all I have for some reason solved that it will be better if to put Open-jdk вмето sun’овского. All right has put сановкий jdk. And here I was waited by a surprise, probably the driver clumsy or that, but at any deal was Result Set Type is not supported. It turns out from MSAccess it was necessary отказыватся, I am better than anything mysql haven't thought up. It is necessary to tell to put mysql php apache I didn't want, since for these purposes I wanted to put FreeBSD on an old computer. Well all right I think it is useful mysql for something. Since php it would not be desirable to put, has solved well I will try through perl it should be not difficult, but the module (or how it there?) DBD:ODBC It has not appeared, about its attempt to deliver Makefile.pl has given out what that errors, to understand in which небыло any desire. Then for import, has solved поробовать mdbtools, knowingly put, but on how many I could understand import went only in csv, well I think here on python I will try, the blessing with csv I on it already worked, but here for me waited подлянка, for work with mysql it was necessary to deliver something, and there was already a laziness. It like in mysql to me was last attempt kexi under FreeBSD has thrown (or not, непомню), but here she refused to do it and fell. про попытке запуска прога выпадала с исключением, ещё бы ведь я почему-то решил что будет лучше если поставить Open-jdk вмето sun’овского. Ладно поставил сановкий jdk. И тут меня ждал сюрприз, видимо драйвер корявый или что, но при любом раскладе было Result Set Type is not supported. Получается от MSAccess надо было отказыватся, ничего лучше mysql я не придумал. Надо сказать ставить mysql php apache я не хотел, т.к. для этих целей я хотел поставить FreeBSD на старый комп. Ну ладно думаю пригодится mysql ещё для чего-нибудь. т.к. php ставить не хотелось, решил ну попробую через perl не сложно должно быть, но модуля(или как он там?) DBD:ODBC не оказалось, про попытке его доставить Makefile.pl выдал какие то ошибки, разбираться в которых небыло никакого желания. потом для импорта, решил поробовать mdbtools, не зря же ставил, но на сколько я смог понять импорт шёл только в csv, ну думаю тут на python попробую, благо с csv я на нём уже работал, но тут меня ждала подлянка, для работы с mysql надо было что-то доставить, а было уже лень. Последней попыткой была kexi под FreeBSD она вроде в mysql мне перекинула(или нет, непомню), но тут она отказывалась это делать и падала.
Уторо evenings мудренее. Уторо вечера мудренее.
It was necessary to put at once php and not to show off, ah moreover it was necessary to rock the driver odbcmysql and to adjust, but these are trifles. скриптик idle time of anything difficult Надо было сразу поставить php и не выпендриваться, ах да ещё пришлось качнуть драйвер odbcmysql и настроить, но это мелочи. скриптик простой ничего сложного
11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414
| <? php <?php
$r = odbc_connect ("myConnection", "", "");
$r = odbc_connect("myConnection","","");
$q = odbc_exec ($r, "select * from Relation");
$q = odbc_exec($r,"select * from Relation");
$conn = mysql_connect ("localhost", "root", "password");
$conn = mysql_connect("localhost","root","password");
mysql_selectdb ("db1");
mysql_selectdb("db1");
while (odbc_fetch_row ($q)) {
while(odbc_fetch_row($q)){ $PS=odbc_result ($q, "PS"); $PS=odbc_result($q,"PS"); $Parg = odbc_result ($q, "Parg"); $Parg = odbc_result($q,"Parg"); $X = odbc_result ($q, "X"); $X = odbc_result($q,"X"); $R = odbc_result ($q, "relation"); $R = odbc_result($q,"relation"); $Y = odbc_result ($q, "Y"); $Y = odbc_result($q,"Y"); mysql_query ("INSERT INTO Relation (PS, Parg, X, relation, Y) VALUE (' $PS', ' $ Parg ', ' $X ', ' $R ', ' $Y ')"); mysql_query("INSERT INTO Relation (PS,Parg,X,relation,Y) VALUE ('$PS','$Parg','$X','$R','$Y')");
}
?>
?> |
And here I from the reliable start a program, and it to me go wood, table RELATION isn't present, how so? There is it speak (well I haven't got used still that the register matters), all right I rename the table in RELATION, and it to me isn't present table Relation, ah you a sou … = in what mean делат a program in Windows to group the person. Having translated all to the uniform register, java all has eaten and has started to work)и вот я с надежной запускаю прогу, а она мне идите лесом, таблицы RELATION нету, как так? есть она говорю(ну не привык я ещё что регистр имеет значение), ладно переименовываю таблицу в RELATION, а она мне нету таблицы Relation, ах ты су… @= во что значит делат прогу в винде группе человек. Переведя всё к единому регистру, java всё скушала и начала работать)
30Jul 200830Jul 2008
Fresh comments
Свежие комментарии